We have a string s consisting of lowercase English letters. Snuke can perform the following operation repeatedly:    * Insert a letter `x` to any position in s of his choice, including the beginning and end of s.  Snuke's objective is to turn s into a palindrome. Determine whether the objective is achievable. If it is achievable, find the minimum number of operations required.
from sys import stdin
s = (stdin.readline().rstrip())
l = 0
r = 1
ans = 0
exit = (len(s)+1)//2
for i in range(len(s)):
    if s[l] == s[-r]:
        l += 1
        r += 1

    elif s[l] == "x" and s[-r] != "x":
        ans += 1
        l += 1

    elif s[l] != "x" and s[-r] == "x":
        ans += 1
        r += 1

    else:
        ans = -1
        break

    if l == r == exit:
        break

print(ans)
from sys import stdin
s = (stdin.readline().rstrip())
l = 0
r = 1
ans = 0

for i in range(len(s)):

    if l+r >= len(s):
        break

    if s[l] == s[-r]:
        l += 1
        r += 1

    elif s[l] == "x" and s[-r] != "x":
        ans += 1
        l += 1

    elif s[l] != "x" and s[-r] == "x":
        ans += 1
        r += 1

    else:
        ans = -1
        break

print(ans)