import java.util.Scanner; public class Main { public static void main(String[] args){ String s = new Scanner(System.in).nextLine(); s = s + s; int p = 0, q = 0, cnt = 0; while (p < s.length()) { if(s.charAt(p) == '1'){ q = p; ...