import"io"for Stdin var s while(1)System.print((s=Stdin.readLine())[s[1]!=s[2]?4:2])