import java.util.Arrays; import java.util.Scanner; class M{ static Scanner s=new Scanner(System.in); public static void main(String[]$){ System.out.println( Arrays.stream((s.next()+s.next()).split("x")) .mapToInt(String::length) .max().orElse(0) ); } }