import sys def last_len_uniq(s, i, n): return len({c for c in s[i-n:i]}) == n s = input() for i in range(4, len(s) + 1): if last_len_uniq(s, i, 4): print(i) break for i in range(14, len(s) + 1): if last_len_uniq(s, i, 14): print(i) break