import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String N = scan.next(); scan.close(); int k = N.length() - 2; if(k > 7) { System.out.println(k - 8); }else { System.out.println(8 - k); } } }