import java.io.*; import java.util.*; class Main{ public static void main(String[] args) throws IOException{ int bit=8; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); long n=Long.parseLong(br.readLine()); String buf=String.valueOf(n); int count=buf.length()-2; if(bit>=count){ int result=bit-count; System.out.println(result); }else{ int result=count-bit; System.out.println(result); } } }