import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s1 = sc.next(); String s2 = "1000000007"; int ans = Math.abs(s1.length() - s2.length()); System.out.println(ans); } }