public class MainClass { public static void main(String[] argv) { String str = "ababc"; System.out.println(str.split("(ab)*").length); } }
3