Need help for code to detect last number - C#