There are N children in AtCoder Kindergarten. Mr. Evi will arrange the children in a line, then give 1 candy to the first child in the line, 2 candies to the second child, ..., N candies to the N-th child. How many candies will be necessary in total?
S = input()
for i in range(len(S)-2):
    s = S[i:i+3]
    if s[0] == s[1] or s[0] == s[2] or s[1] == s[2]:
        print(i,i+2);exit()
print("-1 -1")
n=int(input());print((n+1)*n//2)