using System; namespace No671 { public class Program { public static void Main(string[] args) { switch (Console.ReadLine()) { case "107": Console.WriteLine(7); return; case "1007": Console.WriteLine(6); return; case "10007": Console.WriteLine(5); return; case "100007": Console.WriteLine(4); return; case "1000007": Console.WriteLine(3); return; case "10000007": Console.WriteLine(2); return; case "100000007": Console.WriteLine(1); return; case "1000000007": Console.WriteLine(0); return; case "10000000007": Console.WriteLine(1); return; case "100000000007": Console.WriteLine(2); return; case "1000000000007": Console.WriteLine(3); return; case "10000000000007": Console.WriteLine(4); return; case "100000000000007": Console.WriteLine(5); return; } } } }