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