import java.util.Arrays; import java.util.Scanner; import java.util.stream.IntStream; public class Main{ static Scanner s=new Scanner(System.in); static int getInt(){return Integer.parseInt(s.next());} static IntStream REPS(int v){return IntStream.range(0,v);} static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);} static IntStream INS(int n) {return REPS(n).map(i->getInt());} static class Pair{ T l;U r; Pair(T L,U R){l=L;r=R;} T getL(){return l;} U getR(){return r;} } public static void main(String[]$){ System.out.println( Arrays.stream((s.next()+s.next()).split("x")) .mapToInt(String::length) .max().getAsInt() ); } }