#!/usr/bin/python3 import sys line = sys.stdin.readline().rstrip() i = 0 while i < len(line) - 13: s = set(list(line[i:i+14])) if len(s) == 14: print(i + 14) break i += 1