a = list(input()) b = a.pop(0) c = set(a) print(a, b, c) if b == '1' and len(c) == 1: print(len(a)) else: print('-1')