output_description: If the objective is achievable, print the number of operations required. If it
  is not, print `-1` instead.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      s
attempt: S = input()
  st = 0
  la = len(S) - 1
  result = 0
  
  while(st > la):
    if S[st]== 'x' and S[la]== 'x':
      st += 1
      la += 1
      continue
    if S[st] != 'x' and S[la]== 'x':
      result += 1
      la += 1
    elif S[st] == 'x' and S[la] != 'x':
      result += 1
      st += 1
    else
      result = -1
      break
  
   print(result)
    
problem_description: Statement
  
  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.
samples: [{"input": "xabxa", "output": "2\n    \n\nOne solution is as follows (newly inserted `x` are shown in bold):\n\nxabxa \u2192 xa**x** bxa \u2192 xaxbxa**x**\n\n* * *"}, {"input": "ab", "output": "-1\n    \n\nNo sequence of operations can turn s into a palindrome.\n\n* * *"}, {"input": "a", "output": "0\n    \n\ns is a palindrome already at the beginning.\n\n* * *"}, {"input": "oxxx", "output": "3\n    \n\nOne solution is as follows:\n\noxxx \u2192 **x** oxxx \u2192 **x** xoxxx \u2192 **x** xxoxxx"}]