n = input() if n[-1] == "3": print(len(n) - 1) else: print(-1)