import java.util.Scanner; public class hogeeee { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int i = s.length()-"1000000007".length();; if(i<0) { System.out.println(i*-1); }else { System.out.println(i); } } }