using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Code { class Program { static void Main(string[] args) { string E = Console.ReadLine(); int i; if (E[0] != '1') { i = -1; } else { int len = E.Length; int t; for (t = 1; t < E.Length; t++) { if (E[t] != '3') break; } if (t == E.Length) i = E.Length - 1; else i = -1; } Console.WriteLine(i); } } }