public class No_203 { //休日の数を数える static int holiday(StringBuffer w, int c) { c++; if (c >= w.length() || !(w.charAt(c) == 'o')) { return c; } return holiday(w, c); } //平日の数を数える static int weekday(StringBuffer w, int c) { c++; if (c >= w.length() || !(w.charAt(c) == 'x')) { return c; } return weekday(w, c); } public static void main(String[] args) { java.util.Scanner sc = new java.util.Scanner(System.in); String s = sc.next() + sc.next(); StringBuffer week = new StringBuffer(s); int count = 0, max = 0; while (!week.toString().isEmpty()) {//文字列が無くなったら終わり if (week.charAt(0) == 'o') { count = holiday(week, 0); week.delete(0, count);//count分削除 max = Math.max(max, count); } else { count = weekday(week, 0); week.delete(0, count);//count分削除 } } System.out.println(max); sc.close(); } }