static int countDots(S s) { int n = l(s), count = 0; for i to n: if (s.charAt(i) == '.') ++count; ret count; }