package algo; import java.util.Scanner; public class sample7 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N = sc.next(); char[] c = N.toCharArray(); int cnt = 0; for(int i = 1; i < c.length; i++) { if(c[0] == '1' && c[i] == '3') { cnt++; } else { System.out.println(-1); return; } } System.out.println(cnt); } }