using System;
public class FSumDigits
{
public static int SumDigits(int n)
{
string number = Convert.ToString(n);
int sum = 0;
for (int i = 0; i < number.Length; i++)
sum += Convert.ToInt32(number.Substring(i, 1));
return sum;
}
public static void Main()
{
Console.WriteLine(SumDigits(123));
}
}