using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { char[] cs = Console.ReadLine().ToCharArray(); List listn = new List(); int s; int a = 0; int count = 0; for (int i = 0; i < cs.Length; i++) { if (int.TryParse(cs[i].ToString(), out s)) { listn.Add(int.Parse(cs[i].ToString())); } } for (int i = 0; i < listn.Count; i++) { count = count + listn[i]; } Console.WriteLine(count); } } }