using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { string line = Console.ReadLine(); int sum = 0; for (int i = 0; i < line.Count(); i++) { sum += int.Parse(line.Substring(i, 1)); } Console.WriteLine(sum); } } }