using System; public class Program { static void Main() { string S = Console.ReadLine(); string S_ = ""; int _S = 0; int result = 0; for (int i = 0; i < S.Length; i++) { S_ = S.Substring(i,1); if (int.TryParse(S_, out _S)) { result += _S; } } Console.WriteLine(result.ToString()); } }