Problem:


Score : 200 points

Problem Statement

Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.

Given is a string S. Find the minimum number of hugs needed to make S palindromic.

Constraints

S is a string consisting of lowercase English letters.

The length of S is between 1 and 100 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

Print the minimum number of hugs needed to make S palindromic.

Sample Input 1

redcoder

Sample Output 1

1

For example, we can change the fourth character to o and get a palindrome redooder.

Sample Input 2

vvvvvv

Sample Output 2

0

We might need no hugs at all.

Sample Input 3

abcdabc

Sample Output 3

2



Sample input:
redcoder


Sample output:
1

Submission status: Accepted

Solution code:
s = input()
if((len(s) >= 1)and(len(s) <= 100)):
  ls1 = []
  ls2 = []
  count = 0
  for char in s:
    ls1.append(char)
  ls2 = ls1.copy()
  ls1.reverse()
  for i in range(int(len(ls2)/2)):
    if (ls1[i] != ls2[i]):
      count += 1
  print(count)

Submission status: Accepted

Solution code:
S = input()
count = 0
first = S[:len(S)//2]
second = S[(len(S)+1)//2:]
if first == reversed(second):
    print(count)
else:
    for i in range(len(first)):
        if first[i] != second[len(second)-i-1]:
            count += 1
    print(count)

Submission status: Accepted

Solution code:
counter = 0
text = input()
if len(text) % 2 != 0:
    left = int(len(text)/2) + 1
    right = len(text) - int(len(text)/2)-1
else:
    left = int(len(text)/2)
    right = len(text) - int(len(text)/2)
left_p = text[:right]
right_p = text[left:]
for i in range(0, len(left_p)):
    if (left_p[i] != right_p[len(right_p)-i-1]):
        counter += 1
print(counter)

Submission status: Accepted

Solution code:
s=input()
l=len(s)
ct=0
for i in range(l//2):
  if s[i]!=s[l-1-i]:
    ct+=1
    
print(ct)

Submission status: Accepted

Solution code:

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline 
readlines = sys.stdin.readlines

#n = int(input())
#h,w = [int(i) for i in readline().split()]

s = input()

n = len(s)
ans = 0
for i in range(n):
    #print(s[i],s[-i-1])
    if s[i] != s[-i-1]:
        ans += 1
    #print(ans)

print(ans//2)

Submission status: Accepted

Solution code:
a= input().strip()
l = int(len(a) //2 )
if len(a) % 2 != 0:
  l += 1
l2 = int(len(a))
k1 = list(a[0:l])
k2 = list(a[l:l2])

k2.reverse()

ans = 0
idx = 0
for i in k2:
  if k1[idx] != k2[idx]:
    ans +=1
  idx +=1
print(ans)

Submission status: Accepted

Solution code:
a = input()
b = list(a)
c = list(a[::-1])
if b == c:
    print(0)
else:
    d = len(a)
    count = 0
    for i in range(0,d):
        if b[i] != c[i]:
            count += 1
        else:
            pass
    print(int(count/2))

Submission status: Accepted

Solution code:
word = input()
count = 0
s1 = word[:len(word)//2]
s2 = word[len(word)//2:]
if s1 == reversed(s2):
    print(count)
else:
    for i in range(len(s1)):
        if s1[i] != s2[len(s2)-i-1]:
            count = count + 1
    print(count)

Submission status: Accepted

Solution code:
str1 = input()
str2 = list(str1)
n = (int(len(str1)/2))
count = 0
for i in range(1, n+1):
    if(str2[i-1]!=str2[-1*i]):
        count = count+1        
print(count)

Submission status: Accepted

Solution code:
S = input()
i = 0
j = len(S)-1
ans = 0
while i < j:
    if S[i] != S[j]: ans += 1
    i += 1
    j -= 1
print(ans)

Submission status: Accepted

Solution code:
S = input()
n = len(S)//2
cnt = 0
for i in range(0,n):
  if S[0:n][i] != S[::-1][0:n][i]:
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
a = list(input())
b = a[::-1]
s = len(a)
ans = 0

for i in range(s):
 
  if a[i] != b[i]:
    ans = ans + 1
if ans%2 == 0:
  print(int(ans/2))
else:
  print(ans)

Submission status: Accepted

Solution code:
s = input()
s = list(s)
judge = len(s)
todo = 0
if judge % 2 == 0:
    todo = judge / 2
else:
    todo = (judge-1) / 2
count = 0
for i in range(int(todo)):
    num = 0 - (i+1)
    if s[i] != s[num]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n = input()
n = list(n)
m = len(n) 
A = 0
if m % 2 == 0:
    K = int(m/2)
    a = n[0:K]
    n.reverse()
    b = n[0:K]
else:
    K = int((m - 1) / 2)
    a = n[0:K]
    n.reverse()
    b = n[0:K]
for i, value in enumerate(a):
    if value != b[i]:
        A = A + 1

print(A)

Submission status: Accepted

Solution code:
s = input()
count = 0
k = len(s)
for i in range(k//2):
	if s[i] != s[k-i-1]:
		count += 1
print(count)

Submission status: Accepted

Solution code:
S = input()
rev_S = S[::-1]

cou = 0
for i in range(len(S)):
    if S[i] != rev_S[i]:
        cou += 1

print(cou//2)

Submission status: Accepted

Solution code:
S = input()
L = len(S)
ans =0
for i in range(L//2):
  if S[i] != S[-1-i]:
    ans +=1
    
print(ans)

Submission status: Accepted

Solution code:
S = input()

max_ans = len(S) // 2
ans = 0

for i in range(max_ans):
  if S[i] != S[-i-1]:
    ans += 1 
  
print(ans)

Submission status: Accepted

Solution code:
s = input()
count=0
for i in range(len(s)//2):
    if s[i] != s[len(s)-i-1]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
S = input()
count=0

for i in range(len(S)//2):
    if S[i] != S[-(i+1)]:
        count+=1
    
print(count)

Submission status: Accepted

Solution code:
S=input()
n=len(S)
ans=0
for i in range(n//2):
    if S[i]!=S[n-i-1]:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
string = list(input())
length = len(string)
l = list()
if length % 2 ==0:
    for i in range (int(length/2),length):
        l.append(string[i])
    l.reverse()
else:
    for i in range (int(length/2)+1,length):
        l.append(string[i])
    l.reverse()
result = 0
for i in range(len(l)):
    if not l[i] == string[i]:
        result = result + 1
print(result)

Submission status: Accepted

Solution code:
s = list(input())
p = len(s)
cnt = 0
for i in range(0, int(p / 2)):
    if s[i] != s[p-i-1]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
S = list(str(input())) 
ans = 0

if len(S)%2 == 0:
    for i in range(len(S)//2):
       if S[i] != S[len(S)-i-1]:
           ans += 1
    print(ans)
    
else:
    for i in range((len(S)-1)//2):
       if S[i] != S[len(S)-i-1]:
           ans += 1
    print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
 
S=input().rstrip()
R=list(S)
R.reverse()
R = "".join(R)
l = int(len(S)/2)
rtn=0
for i in range(l):
  if S[i]!=R[i]:
    rtn+=1
print(rtn)

Submission status: Accepted

Solution code:
s = input()
cnt = 0
if len(s) % 2 == 1:
    half = (len(s)-1)//2
else:
    half = len(s)//2
l1 = list(s[:half])
l2 = list(reversed(s[-half:]))
for i in range(len(l1)):
    if l1[i] != l2[i]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
S = input()
T = S[::-1]
cnt = int(0)
for i in range(len(S)):
    if S[i] != T[i]:
        cnt += 1
print(int(cnt/2))

Submission status: Accepted

Solution code:
S = input()
nagasa = len(S) // 2
mae = S[0:nagasa]
ato = S[:-nagasa-1:-1]
diff = 0
for i in range(nagasa):
  if mae[i] != ato[i]:
    diff += 1

print(diff)

Submission status: Accepted

Solution code:
import sys

s = input()
if len(s) == 1:
    print(0)
    sys.exit(0)

sb = s[:len(s)//2]
if len(s) % 2 == 1:
    sa = s[len(s)//2+1:]
else:
    sa = s[len(s)//2:]
sa = sa[::-1]

cnt = 0
for i,b in enumerate(sb):
    if b != sa[i]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
text = input()
if (len(text) % 2 != 0):
    left = int(len(text)/2) + 1
    right = len(text) - int(len(text)/2)-1
else:
    left = int(len(text)/2)
    right = len(text) - int(len(text)/2)

score = 0

left_part = text[:right]
right_part = text[left:]

for i in range(0, len(left_part)):
    if (left_part[i] != right_part[len(right_part)-i-1]):
        score += 1

print(score)

Submission status: Accepted

Solution code:
S = list(input())
N=len(S)
num=int(N/2)
count = 0
for i in range (num):
    if(S[i]==S[N-i-1]):
        pass
    else:
        count=count+1
print(count)

Submission status: Accepted

Solution code:
S = input()
ans=0
L=len(S)
l=int(L/2)
for n in range(l):
    if not(S[n]==S[L-(n+1)]):
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
s = input().strip()
sLenHalf = int(len(s) / 2)
cnt = 0
for i in range(sLenHalf):
    if s[i] != s[(-1-i)]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import math

S = input()
flag=0
for i in range(math.ceil(len(S)//2)):
  if S[i]!=S[-i-1]:
    #print(S[i]==S[-i-1])
    flag+=1
print(flag)

Submission status: Accepted

Solution code:
s = input()
string = list()
for letter in s:
	string.append(letter)
# print(string)
counter = 0
length = int(len(s) / 2)
i = 0
for i in range(length):
	if string[i] != string[len(s) - i - 1]:
		counter += 1
print(counter)

Submission status: Accepted

Solution code:
S = list(input())
cnt = 0
for i in range(len(S)):
    #print(S[i],S[-(i+1)])
    if S[i] != S[-(i+1)]:
        S[i] = S[-(i+1)]
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
s = list(input())
c = 0
for i in range(len(s)//2):
    if s[i] is not s[-i-1]:
        c += 1

print(c)

Submission status: Accepted

Solution code:

import math
S = input()
s = list(S) #文字を一文字ずつリスト格納
count=0
N=int(math.ceil(len(s)/2))

for i in range(N):
 if not s[i]==s[len(s)-i-1]:
  count+=1

print(count)

Submission status: Accepted

Solution code:
from sys import stdin


def fetch_one_line():
    return stdin.readline().rstrip()


def fetch_int_input():
    return [int(s) for s in fetch_one_line().split()]


def fetch_inputs(times):
    return [fetch_one_line() for _ in range(times)]


def fetch_int_inputs(times):
    return [[int(s) for s in fetch_one_line()] for _ in range(times)]


rotate_candidate = fetch_one_line()
half_len = int(len(rotate_candidate) / 2)

hug_num = 0
for i in range(half_len):
    if rotate_candidate[i] != rotate_candidate[-(i+1)]:
        hug_num += 1

print(hug_num)

Submission status: Accepted

Solution code:
alpha = str(input())
beta = alpha[::-1]

x = 0
for i in range(len(alpha)):
    if alpha[i] != beta[i]:
        x += 1
print(x//2)

Submission status: Accepted

Solution code:
s = list(input())

a = s[::-1]

ans = 0
for i in range(len(s)):
    if a[i] != s[i]:
        ans += 1

print(ans//2)

Submission status: Accepted

Solution code:
s = list(input())
count = 0

for i in range(len(s)//2):
  if s[i] != s[len(s)-i-1]:
    count +=1

print(count)

Submission status: Accepted

Solution code:
s = list(input())

s1 = list(s[0:int(len(s) / 2 + 0.5)])
s2 = list(s[int(len(s) / 2):len(s)])

s2.reverse()

count = 0

for i in range(int(len(s) / 2+0.5)):
   if s1[i] != s2[i]:
      count += 1

print(count)

Submission status: Accepted

Solution code:
s = list(map(str, input()))

import math
if len(s)%2 == 0:
    c = math.floor(len(s)/2)
    l = s[0:c]
    r = list(reversed(s[c:len(s)]))
elif len(s)%2 == 1:
    c = math.floor((len(s))/2)
    l = s[0:c]
    r = list(reversed(s[c+1:len(s)]))
    
count = 0
for i in range(len(l)):
    if l[i] != r[i]:
        count += 1
    else:
        continue
        
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

from math import ceil,floor

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# list = list(map(int, input().split()))

# def func(a):
#    return tmp

S = input()

ans = 0

for i in range(0,len(S)//2):
    if S[i]!=S[len(S)-i-1]:
        ans=ans+1

print(ans)

Submission status: Accepted

Solution code:
s = str(input())

if len(s)%2 == 0:
  a = s[:len(s)//2]
  b = s[len(s)//2:]
else:
  a = s[:len(s)//2]
  #_ = s[len(s)//2]
  b = s[(len(s)//2)+1:]
  
cnt = 0
for i,j in zip(a,b[::-1]):
  if i!=j:
    cnt += 1
  
print(cnt)

Submission status: Accepted

Solution code:
S = list(input())
tem = int(len(S)/2)

counter = 0
for i in range(tem):
  if S[i] != S[-i-1]:
    counter = counter + 1

print(counter)

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
sr = reversed(s)
count = 0
for i in range(n // 2):
    if s[i] == s[n-i-1]:
        count += 1
print(n // 2 - count)

Submission status: Accepted

Solution code:
s = input()
count = 0

for i, c in enumerate(s):
    if i > int(len(s) / 2) - 1:
        break
    if c != s[-i - 1]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
S=input()
hug=0
for i in range(len(S)//2):
  if S[i]!=S[len(S)-i-1]:hug+=1
print(hug)

Submission status: Accepted

Solution code:
S=input()
length = len(S)
# 例えば5->2,1,2,  4->2,2 に分けて調べれば良い
if length % 2 == 0:
    half = length//2
    mae = S[0:half]
    ushiro = S[half:]
else:
    half = (length)//2
    mae = S[0:half]
    ushiro = S[half+1:]
count = 0
for (s1,s2) in zip(mae,ushiro[::-1]):
    if not s1 == s2:
        count += 1
print(count)

Submission status: Accepted

Solution code:
str = input()
size = len(str)
cnt = 0
i = 0

for i in range(int(size/2)):
    if str[i] != str[size-1-i]:
        cnt = cnt+1



print(cnt)

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 == 0:
    m = int(len(S) / 2)
else: 
    m = int(len(S) / 2) + 1

ans = 0
for i in range(0, m):
    if S[i] != S[len(S) - 1 - i]:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
S=input()
n=0
if len(S)%2==0:
    for i in range (0,int((len(S))/2)):
        if S[i]!=S[-i-1]:
            n+=1
else:
    for i in range (0,int(((len(S))+1)/2)):
        if S[i]!=S[-i-1]:
            n+=1
print(n)

Submission status: Accepted

Solution code:
s=input()
c=0
for i in range(len(s)//2):
    if s[i]!=s[len(s)-i-1]:
        c+=1
print(c)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

S = input().rstrip()
n = len(S)//2 if not len(S)%2 else len(S)//2+1
L = len(S)

cnt = 0
for i in range(n):
	# print(S)
	# print(i, L-i-1)
	# print(S[i], S[L-i-1])
	if i == L-i-1: continue
	if S[i]==S[L-i-1]: continue
	else: cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
S = str(input())
Slist = list(S)
newlist = list(reversed(Slist))
ans = 0
for i in range((len(S)//2)):
  if Slist[i] != newlist[i]:
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
S = input()
len_S = len(S)
c = 0
s = len_S // 2
for i in range(s):
    if S[i] is not S[len_S-1 -i]:
        c += 1
print(c)

Submission status: Accepted

Solution code:
a = input()
m = len(a)
if m % 2 == 0:
  ind = int(m/2)
else:
  ind = int((m-1)/2)

a1 = a[:ind]
a2 = a[-ind:][::-1]

ans = len(list(filter(lambda x: x[0] != x[1], zip(a1, a2))))

print(ans)

Submission status: Accepted

Solution code:
S=input()
N=len(S)
counter=0
if N %2 ==0:
    half = int(N/2)
elif N%2==1:
    half = int((N-1)/2)

for i in range(half):
    if S[i]==S[-i-1]:
        pass
    else:
        counter= counter+1
print(counter)

Submission status: Accepted

Solution code:
def palin(S):
    lst = list(S)
    num = len(lst)//2
    count = 0
    for i in range(num):
        if not lst[i] == lst[-i-1]:
            count += 1
    return count

S = input()
print(palin(S))

Submission status: Accepted

Solution code:
from sys import stdin
s = stdin.readline().rstrip()

j = 0
for i in range(len(s)//2):
 if s[i] != s[-i-1]:
  j=j+1
print(j)

Submission status: Accepted

Solution code:
s = input()
c = 0
first, second = s[:len(s)//2], s[(len(s)+1)//2:]
if first == reversed(second):
    print(c)
else:
    for x in range(len(first)):
        if first[x] != second[len(second)-x-1]:
            c += 1
    print(c)

Submission status: Accepted

Solution code:
S = input()

lS = len(S)
if lS % 2 == 0:
    mind = int(lS/2)
    maeS = S[:mind]
    atS = S[mind:]
#     print(maeS, atS)
else:
    mind = int(lS//2)
    maeS = S[:mind]
    atS = S[mind+1:]
#     print(maeS, atS)
#     print(atS[::-1])

revatS = atS[::-1]
count = 0
# print(maeS, revatS)
for i in range(len(maeS)):
#     print(maeS[i],revatS[i])
    if maeS[i] != revatS[i]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
import math

S = input()
l = len(S)
count = 0

for i in range(math.floor(l/2)):
    if S[i] != S[l-1-i]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
S = input()
rS = S[::-1]

cnt = 0
for s, r in zip(S, rS):
    if s != r:
        cnt += 1

print(cnt // 2)

Submission status: Accepted

Solution code:
bun = input()
i = 0
hug = 0
while i < int(len(bun)/2):
  if bun[i] == bun[len(bun)-i-1]:
    i += 1
  else:
    hug += 1
    i += 1
print(hug)

Submission status: Accepted

Solution code:
s = input()
slist = list(s)
count = 0

for i in range(len(slist) - 1):
    b = (len(slist) - 1) - i
    if (slist[i] != slist[b]):
        slist[b] = slist[i]
        count += 1
print(count)

Submission status: Accepted

Solution code:
validate_list, s = list(), list(input())
validate_list = [s[i] == s[-i - 1] for i in range(len(s))]
print(int(validate_list.count(False)/2))

Submission status: Accepted

Solution code:
a = input()
q =0
if len(a) % 2 == 0:
  qq = len(a)//2
else :
  qq =len(a)//2 +1
for i in range(qq) :
  if a[i] != a[-i-1] :
    q+=1
print(q)

Submission status: Accepted

Solution code:
S =input().strip()

c=0
for i in range(len(S)//2):
    if S[i]!=S[-(i+1)]:
        c+=1
print(c)

Submission status: Accepted

Solution code:
def abc147_b():    
    s = input()

    check_str_list = []
    chesk_str_list_reverse = []
    rev_cnt = 0

    for i in range(len(s) // 2):
        check_str_list.append(s[i])
        rev_cnt -= 1
        chesk_str_list_reverse.append(s[rev_cnt])

    result = 0

    for i in range(len(check_str_list)):
        if check_str_list[i] != chesk_str_list_reverse[i]:
            result += 1

    print(result)
if __name__ == '__main__':
    abc147_b()

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
res = 0

for i in range(n):
    if s[i] != s[n-1-i]:
        s[n-1-i] = s[i]
        res += 1

print(res)

Submission status: Accepted

Solution code:
S = input()
ans = 0
for i in range(len(S)//2):
  if S[i] != S[-i-1]:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
S = input()

T = S[::-1]

ans = 0
for s, t in zip(S, T):
    if s != t:
        ans += 1

print(ans // 2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S=str(input())
N=len(S)
k=0
for i in range(0,N//2,1):
    if S[i]!=S[N-1-i]:
        k+=1
print (k)

Submission status: Accepted

Solution code:
a = input()
b = 0
for i, j in zip(a, a[::-1]):
	if i != j:
		b += 1

print(b//2 + b%2)

Submission status: Accepted

Solution code:
S=str(input())

count = 0

l=[]

l = list(S)

a = len(l)

b = a - 1

for i in range(a):
    if l[i] != l[b-i]:
        count = count + 1

count = count/2

print(int(count))

Submission status: Accepted

Solution code:
S = list(input())
count = 0

for i in range(int(round(len(S)/2))):
    if S[i] != S[len(S)-1-i]:
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
S = input()
cnt = 0

sb = len(S) // 2
fs = S[:sb]
bs = S[-sb:]

if fs == bs[::-1]:
  cnt = 0
else:
  for i in range(len(fs)):
    if fs[i:i+1] != bs[::-1][i:i+1]:
      cnt += 1
      
print(cnt)

Submission status: Accepted

Solution code:
s = input()
if len(s)%2==0:
    s1 = s[:len(s)//2]
    s2 = s[len(s)//2:]
else:
    s1 = s[:len(s)//2]
    s2 = s[len(s)//2+1:]
s2 = s2[::-1]
num=0
for i in range(len(s1)):
    if s1[i]!=s2[i]:
        num+=1
print(num)

Submission status: Accepted

Solution code:
s=input()
s=list(s)
n=len(s)
i=0
count=0
while i<=n//2:
  if not s[i]==s[-1-i]:
    s[-1-i]=s[i]
    count+=1
  i+=1
print(count)

Submission status: Accepted

Solution code:
s = input()
ans = 0
l, r = 0, len(s)-1
while l < r:
    if s[l] != s[r]:
        ans += 1
    l += 1
    r -= 1
print(ans)

Submission status: Accepted

Solution code:
S = input()
l = int(len(S))
n = int((l-1)/2)
m = int(l/2)
count = 0
if l%2 == 1 :
    for i in range(0, n) :
        if S[i] != S[l-1-i]:
            count += 1
else:
    for i in range(0, m):
        if S[i] != S[l-1-i]:
            count += 1
print(count)

Submission status: Accepted

Solution code:
s = input()
i = 0
t = 0
while i < len(s) - 1 - i:
    if s[i] != s[len(s)-1-i]:
        t += 1
    i += 1
print(t)

Submission status: Accepted

Solution code:
S=input()
l=len(S)

count=0

if l%2==0:
    for i in range(l//2):
        if S[i]!=S[(l-1)-i]:
            count+=1
else:
    for j in  range((l-1)//2):
        if S[j]!=S[(-1)-j]:
            count+=1

print(count)

Submission status: Accepted

Solution code:

S = list(input())
N = len(S)

p = 0 #スライス前
o = 0 #変更回数
u = N #スライス後


if N % 2 == 0:
    #('偶数処理開始')
    for i in range(int(N/2)):
        if S[p] == S[u-1]:
            #print('偶数で一致'+ str(S[p]) + str(S[u-1]))
            p += 1
            u -= 1
        else:
            #print('偶数で不一致'+ str(S[p]) + str(S[u-1]))
            o += 1
            p += 1
            u -= 1
else:
    N -= 1
    #print('奇数処理開始')
    for i in range(int(N/2)):
        if S[p] == S[u-1]:
            #print('奇数で一致' + str(S[p]) + str(S[u-1]))
            p += 1
            u -= 1
        else:
            #print('奇数で不一致'+ str(S[p]) + str(S[u-1]))
            o += 1            
            p += 1
            u -= 1
print(o)

Submission status: Accepted

Solution code:
a = input()
length = len(a)
#切り上げ
n = -(-length//2)
c = 0
for i in range(n):
    if a[i] == a[-i-1]:
        c =c
    else:
        c +=1
print(c)

Submission status: Accepted

Solution code:
def main():
  S = input()
  half = int(len(S) / 2) if len(S) % 2 == 0 else int((len(S) - 1) / 2)
  first = []
  latter = []
  count = 0

  for i in range(half):
    first.append(S[i])
    latter.append(S[-i-1])

  for i in range(half):
    count += 0 if first[i] == latter[i] else 1

  print(count)
  

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
s = input()

size = len(s)

ans = 0

for i in range(size // 2):
    if s[i] == s[-i-1]:
        continue
    else:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
s = input()
n = len(s)
c = 0
for i in range(n//2):
  if s[i] != s[-i-1]:
    c += 1
print(c)

Submission status: Accepted

Solution code:
S = input()
res_first = S[0:len(S) // 2]
res_second = S[len(S) // 2 if len(S) % 2 == 0
               else ((len(S) // 2) + 1):]
count = 0

for i in range(0, len(res_first)):
    if res_first[i] != res_second[len(res_second)-i-1]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
s = input()
count = 0
first_half, second_half = s[:len(s)//2], s[(len(s)+1)//2:]
if first_half == reversed(second_half):
    print(count)
else:
    for x in range(len(first_half)):
        if (first_half[x] != second_half[len(second_half)-x-1]):
            count += 1
    print(count)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    input_data = input('')
    count = 0
    length = len(input_data)
    for i in range(int(length/2)):
        if not input_data[i] == input_data[length-1-i]:
            count += 1
    print(count)

Submission status: Accepted

Solution code:

s = input()
ans=0
for i in range(len(s)//2):
    if s[i] != s[-i-1]:
        ans +=1

print(ans)

Submission status: Accepted

Solution code:
S = input()
print(len([0 for i in range(len(S) // 2) if S[i] != S[-i-1]]))

Submission status: Accepted

Solution code:
s = list(input())
count = 0
for i in range(len(s)//2):
    if s[-1*i-1] != s[i]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
a = list(input())
b = list(reversed(a))
count =0
for i in range(len(a)//2):
    if b[i] != a[i]:
        count +=1
print(count)

Submission status: Accepted

Solution code:
s=input()
r=[]
a=0
for i in range(len(s)):
 r.append(s[len(s)-i-1])
for i in range(len(s)//2):
    if s[i]!=r[i]:
        a+=1
print(a)

Submission status: Accepted

Solution code:
S = input()

S_length = len(S)

result = 0
for i in range(S_length // 2):
    if S[i] != S[-i-1]:
        result += 1
print(result)

Submission status: Accepted

Solution code:
import math

def countHugs(input_string):
  string_arr = [char for char in input_string]
  hugs = 0
  for r in range(0, (math.ceil(len(string_arr)/2))):
    pointerA = string_arr[r]
    pointerB = string_arr[-(r+1)]
    if pointerA != pointerB:
      hugs += 1
  print(hugs)

if __name__ == "__main__":
    input_string = input()
    countHugs(input_string)

Submission status: Accepted

Solution code:
s = list(map(str,input()))


n = int(len(s))
m = int(len(s))-1
l = int(n/2)


ans = int(0)

for i in range(l):
    if s[i] == s[m-i]:
        continue
    else:
        ans += 1


print(ans)

Submission status: Accepted

Solution code:
a = list(map(str,input()))
b = a[::-1]
ans = 0
for i in range(len(a)//2):
    if a[i]!=b[i]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
s = input()
l = list(s)
cnt = 0
for i in range(len(l)//2):
  if l[i]!=l[-i-1]:
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
S = input()

length = len(S)

cnt = 0
back = -1
for i in range(length//2):
	if S[i] != S[back - i]:
		cnt +=1
	
print(cnt)

Submission status: Accepted

Solution code:
s = list(input())
k = len(s) // 2
x = 0
for i in range(k):
	if s[i] != s[-1-i]:
		x += 1
print(x)

Submission status: Accepted

Solution code:
S = str(input())

S1 = S[:len(S)//2]
S2 = S[-1:-(len(S)//2 + 1):-1]

ans = 0
for n in range(len(S1)):
    if S1[n] != S2[n]:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
S = input()

# if len(S) % 2 == 0:
itelist = []
slen = int(len(S))
for j in range(int(slen/2),slen):
    itelist.append(j)
revitelist = []
for i in (reversed(itelist)):
    revitelist.append(i)
count = 0
for i in range(0,int(slen/2)):
    if S[i] == S[revitelist[i]]:
        pass
    elif S[i] != S[revitelist[i]]:
        # print("count:" + S[i] + ":" + S[itelist[i]])
        count += 1
print(count)

Submission status: Accepted

Solution code:
#B
S = list(str(input()))
N = len(S)

count = 0
for i in range(N//2):
    if S[i] != S[N-i-1]:
        count+=1
print(count)

Submission status: Accepted

Solution code:
s=input()
s=list(s)
a=0

for i in range((len(s))//2):
    if s[i]!=s[-(i+1)]:
        a+=1
print(a)

Submission status: Accepted

Solution code:
import math
N = list(input())

def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

change_num = math.floor(len(N) / 2)
ans = 0
count = 1
for i in N[:change_num]:
    if N[-count] != i:
        ans += 1
    count += 1
    
print(ans)

Submission status: Accepted

Solution code:
S = [str(x) for x in input()]
length = len(S)
if length%2==0:
    count = 0
    if S[0:int(length/2)] == S[int(length/2):][::-1]:
        print(0)
    else:
        for i in range(int(length/2)):
            if S[i] != S[length-1-i] :
                count+=1
        print(count)
else:
    count=0
    if S[0:int(length//2)] == S[(int(length//2)+1):][::-1]:
        print(0)
    else:
        for i in range(int(length//2)):
            if S[i] != S[length-i-1] :
                count+=1
        print(count)

Submission status: Accepted

Solution code:
S=list(input())

def kai(str):
    return 1 if str == str[::-1] else 0

buf=kai(S)

count=0

if buf==True:
    print(0)
else:
    if len(S)%2==0:
        tmp=S[0:int(len(S)/2)]
        tmp2=S[int(len(S)/2):len(S)+1]
        for a,b in zip(tmp,tmp2[::-1]):
            if a!=b:
                count+=1
    else:
        tmp=S[0:int(len(S)/2)]
        tmp2=S[int(len(S)/2)+1:len(S)+1]
        for a,b in zip(tmp,tmp2[::-1]):
            if a!=b:
                count+=1

if count!=0:
    print(count)

Submission status: Accepted

Solution code:
string = list(input())

n = len(string)

def isEven(N):
    return True if N % 2 == 0 else False

if isEven(n):
    n_half = int(n/2)
else:
    n_half = int(n/2) + 1

left_str = []
right_str = []

for i in range(0,n_half):
    #input()
    left_str.append(string[i])
    right_str.append(string[n-1-i])

# count not matched
notMatch = 0
for i in range(0,len(left_str)):
    if left_str[i] != right_str[i]:
        notMatch += 1
    else:
        continue

print(notMatch)

Submission status: Accepted

Solution code:
"""
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
def xor(x):
	for j in range(n):
		x = bin(x ^ a[j])
		x= int(x[2:])


"""
s = list(input())
k = len(s)//2
a =0
for i in range(k):
	if s[i] is not s[len(s)-i-1]:
		a+=1

print(a)

Submission status: Accepted

Solution code:
s = input()
l = len(s)
s3 = ""
if l%2 == 0:
    s1=s[:l//2]
    s2=s[l//2:]
else:
    s1=s[:l//2]
    s2=s[l//2+1:]
hug = 0
for i in range(l//2):
    if s1[-i-1] != s2[i]:
        hug += 1
print(hug)

Submission status: Accepted

Solution code:
s = input()

count = 0
if len(s) % 2 == 0:
    start = s[:len(s) // 2]
    end = s[len(s) // 2: len(s)]
    end = end[::-1]

    for i, st in enumerate(start):
        if st != end[i]:
            count = count + 1
else:
    start = s[:len(s) // 2]
    end = s[len(s) // 2: len(s)]
    end = end[::-1]

    for i, st in enumerate(start):
        if st != end[i]:
            count = count + 1

print(count)

Submission status: Accepted

Solution code:
s = input()
print(sum(1 for a, b in zip(s, reversed(s)) if a != b) // 2)

Submission status: Accepted

Solution code:
A=input()
AA=list(A)
count=0
for i in range(len(AA)):
    if AA[i] != AA[len(AA)-1-i]:
        count += 1
print(count//2)

Submission status: Accepted

Solution code:
def A():
    nums = [int(n) for n in input().split()]
    if sum(nums) >= 22:
        print('bust')
    else:
        print('win')

def B():
    S = input()
    hugs = 0
    for i in range(len(S)//2):
        if S[i] != S[len(S)-i-1]:
            hugs += 1
    print(hugs)
    
B()

Submission status: Accepted

Solution code:

s = input()

n=len(s)
if n%2==0:
  s_left = s[:n//2]
  s_right = s[n//2:]
else:
  s_left = s[:n//2]
  s_right = s[n//2+1:]
  
s_right = s_right[::-1]
  
count=0
for r,l in zip(s_left, s_right):
  if r!=l:
    count+=1
print(count)

Submission status: Accepted

Solution code:
s = input()
list_s = [c for c in s]
k = len(s)-1
m = int(len(s)/2)
count = 0
for i in range(0,m):
    if list_s[i] != list_s[k-i]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
import math

s = input()
n = len(s)

l = math.floor(n/2)
if n % 2 == 0:
  k = l
else:
  k = l+1
  

s_f = s[:l]
s_r = s[k:]
j = 0

#print(s_f)
#print(s_r)

for i in range(0,l):
  if s_f[i] != s_r[(l-1)-i]:
    #print(s_f[i] + " " + s_r[(l-1)-i])
    j+=1
    
print(j)

Submission status: Accepted

Solution code:
import math

a = input()
b = math.floor(len(a)/2)
N = len(a)-1
count = 0

for i in range(b):
  if a[i] == a[N-i]:
    pass
  else:
    count += 1
print(count)

Submission status: Accepted

Solution code:
s = input()

count = 0
Len = len(s)
half = Len//2
if Len%2 == 0:
    left = s[:half]
    right = s[half:]
    reverse_right = s[::-1]
    #print(left +" "+ right)
    for i in range(half):
        if left[i] != reverse_right[i]:
            count += 1

else:
    left = s[:half]
    right = s[(half+1):]
    reverse_right = s[::-1]
    #print(left +" "+ right)
    for i in range(half):
        if left[i] != reverse_right[i]:
            count += 1

print(count)

Submission status: Accepted

Solution code:
s = input()

sl = len(s)//2
count = 0

if len(s)%2==0:
  s1 = s[:sl]
  s2 = s[sl:]
    
else:
  s1 = s[:sl]
  s2 = s[sl+1:]

for l in range(len(s1)):
  if s1[l]!=s2[len(s1)-1-l]:
    count += 1
    
print(count)