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:
# -*- coding: utf-8 -*-

# input
s = input()

# processing
count = 0

i = 0
j = len(s) - 1
while True:
    if i >= j:
        break
    
    if s[i] != s[j]:
        count += 1
    
    i += 1
    j -= 1

# output
print(count)

Submission status: Accepted

Solution code:
# AtCoder ABC147-B Palindrome-philia

S = input()
num_hug = 0

s1 = S[:len(S)//2]  # 1st half (shorter if odd
s2x = list(S[len(S)//2:]) # 2nd half

for c in s1:
    if c != s2x.pop():
        num_hug += 1
        
print(num_hug)

Submission status: Accepted

Solution code:
s =input()
cnt=0
for i,j in zip(s, s[::-1]):
    if i!=j:
        cnt+=1
print(cnt//2)

Submission status: Accepted

Solution code:
c=input()
a=list(c)
a_r=reversed(a)
b=[x==y for(x,y) in zip(a,a_r)].count(False)
print(b//2)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

print(min_count)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
n = input()

ans=0
for a, b in zip(n, n[::-1]):
    if a != b:
        ans += 1

print(ans//2)

Submission status: Accepted

Solution code:
s=input()
print(sum(a<b for a,b in zip(s,s[::-1])))

Submission status: Accepted

Solution code:
S=input()
length=len(S)
d=0
counter=0
while counter<length:
  if S[counter]==S[length-1-counter]:
    d+=0
    counter+=1
  else:
    d+=1
    counter+=1
print(int(d/2))

Submission status: Accepted

Solution code:
s = input()
print(sum(i != j for i,j in zip(s[:len(s)//2],reversed(s[round(len(s)/2):]))))

Submission status: Accepted

Solution code:
A = input()
A = list(A)
cnt = 0
A_len = len(A)

A_len_h = A_len // 2

for i in range(0, A_len_h):
    if A[i] != A[A_len - i - 1]:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string = str(input())

cnt = 0
for forward, backward in zip(string[:len(string)//2+1], string[-1:len(string)//2-1:-1]):
  if forward != backward:
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

j = len(s)-1
i = 0
ans = 0
while(i < j):
  if s[i] != s[j] :
    ans += 1
    i += 1
    j -= 1
  else:
    i += 1
    j -= 1
    continue
print(ans)

Submission status: Accepted

Solution code:
s=input()
count=0
i=0
while i<(len(s) // 2):
	if s[i]!=s[-(i+1)]:
		count+=1
	i+=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()

le = len(s)

if le % 2 == 0: #文字列の長さが偶数
  mid = int(le / 2)
  s1 = s[:mid]
  s2 = s[mid:]
  count = 0
  for i in range(mid):
    tmp1 = s1[i]
    tmp2 = s2[len(s2) - 1 - i]
    if tmp1 != tmp2:
      count += 1
  print(count)
  exit()

mid  = le // 2
s1 = s[:mid]
s2 = s[mid + 1: ]
count = 0
for i in range(mid):
  tmp1 = s1[i]
  tmp2 = s2[len(s2) - 1 - i]
  if tmp1 != tmp2:
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = list(input())

count = 0  # 入れ替える個数を用意

if len(word) % 2 == 0:  # もしアルファベットの数が偶数の時
  for i in range(0,int(len(word)/2)):
    if word[i] != word[int(len(word))-1-i]:
      count += 1    
  print(count)

else:
  for j in range(0,int((len(word)+1)/2-1)):
    if word[j] != word[int(len(word))-1-j]:
      count += 1
  print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
x = input()
y = x[::-1]
count = 0
for c in range(len(x)):
    i = x[c]
    j = y[c]
    if i != j:
        count += 1
print(count//2)

Submission status: Accepted

Solution code:
str = input()

s = 0
e = len(str) - 1

count = 0

while s < e:

    if str[s] != str[e]:
        count += 1

    s += 1
    e -= 1

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: str):
    N = len(S)
    count = 0
    if N == 1:
        pass
    else:
        for i in range(N//2):
            if S[i] != S[-1-i]:
                count += 1
    print(count)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
str = input()
lst = list(str)
count = 0

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

Submission status: Accepted

Solution code:
s = input()
from collections import deque

q = deque(list(s))

cnt = 0

while q:
	if len(q) == 1:
		q.pop()
	else:
		l = q.popleft()
		r = q.pop()
		if l != r:
			cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

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

Submission status: Accepted

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


def main():
    s = input()
    ans = 0

    for a, b in zip(s, s[::-1]):
        if a != b:
            ans += 1

    print(ans // 2)


if __name__ == '__main__':
    main()

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(sum(s != t for s, t in zip(S, S[::-1])) // 2)

Submission status: Accepted

Solution code:
s = input()

if len(s) % 2 == 1:
    s_1 = s[:len(s)//2]
    s_2 = ''.join(list(reversed(s[len(s)//2+1:])))
else:
    s_1 = s[:len(s)//2]
    s_2 = ''.join(list(reversed(s[len(s)//2:])))
    
c = 0
for i in range(len(s_1)):
    if(s_1[i] != s_2[i]):
        c += 1

print(c)

Submission status: Accepted

Solution code:
import collections

S = collections.deque(input())
ans = 0

while len(S) > 1:
    if S.pop() != S.popleft():
        ans += 1

print(ans)

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s=list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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()
s_each = list(s)
count = 0
c = int (len(s) / 2 )
#print(c)
#print (s_each)

if len(s) % 2 == 0 :
    for i in range(c) :
        if s_each[i] != s_each[-1-i]:
            count += 1

else :
    for i in range(c) :
        if s_each[i] != s_each[-1-i] :
            count += 1

print (count)

Submission status: Accepted

Solution code:
s = input()

l = len(s)

ans = 0

if l%2 == 0:
	a = s[:int(l/2)]
	b = s[int(l/2):]
	
	for i in range(len(a)):
		if a[i]==b[-1*(i+1)]:
			pass
		else:
			ans = ans + 1

else:
	a = s[:int(l//2)]
	b = s[int(l//2)+1:]
	
	for i in range(len(a)):
		if a[i]==b[-1*(i+1)]:
			pass
		else:
			ans = ans + 1

print(ans)

Submission status: Accepted

Solution code:
import math
l = list(input())
if len(l) % 2 == 1:
    l.pop(math.floor(len(l)/2))
count = 0    
for i in range(int(len(l)/2)):
    if l[i] != l[-i-1]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
from sys import exit, stdin
S = list(stdin.readline().rstrip())
len_S = len(S)
if len_S % 2 != 0:
    S.pop(len_S//2)
    len_S -= 1
ans = 0
for i in range(len_S//2):
    if S[i] != S[abs(i-len_S)-1]:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import math
S = list(input())
N = len(S)
K = math.floor(N/2)
S1 = S[:K]
S2 = S[:-K-1:-1]
res = 0
for s1,s2 in zip(S1,S2):
    if(s1 != s2):
        res += 1
print(res)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = str(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:
#!/usr/bin/env python3
s = input()
ans = sum(s[i] != s[~i] for i in range(len(s) // 2))
print(ans)

Submission status: Accepted

Solution code:
s = input()
l = len(s)
s1 = s[:l//2]
s2 = s[l//2:][::-1]
c = 0
for i,j in zip(s1,s2):
  if i != j:
    c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
cnt = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().strip()
ans = 0

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#https://atcoder.jp/contests/abc141/tasks/abc147_b
import sys
#import collections

#n= int(input())
s= input()
#tmp = input().split()
#a,b,c = list(map(lambda a: int(a), tmp))


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

Submission status: Accepted

Solution code:
a = input()
longs = int(len(a))
if(longs % 2 == 0):
    b = a[:int(longs/2)]
    c = a[int(longs/2):]
    twolongs = int(longs/2)
else:
    b = a[:int(longs/2)+1]
    c = a[int(longs/2):]
    twolongs = int(longs/2)+1
#print(b,c)
count = 0
for i in range(twolongs):
    if(b[i]==c[twolongs-i-1]):
        continue
    else:
        count +=1

print(count)

Submission status: Accepted

Solution code:
s = input()
cnt = 0
chk = int(len(s) % 2)
half = int(len(s) / 2)

if chk == 0:
    str1 = s[:half]
    str2 = s[half:]
else:
    str1 = s[:half]
    str2 = s[half+1:]

for i in range(half):
    if str1[i] != str2[half-i-1]:
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    a=sorted([random.randint(0,5) for _ in range(n)])[::-1]
    return n,a

show_flg=False
show_flg=True

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

Submission status: Accepted

Solution code:

S = list(input())

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

Submission status: Accepted

Solution code:
S = input()

c = 0
n = len(S)//2
SS = S[::-1]

S = S[0:n]
SS = SS[0:n]

for i in range(n):
    if S[i] == SS[i]:
        continue
    else:
        c += 1

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def b():
  from math import ceil
  S = input()
  s1,s2 = S[:ceil(len(S) / 2)],S[len(S) // 2:][::-1]
  ans = 0
  for i in range(len(S) // 2):
    ans += int(s1[i] != s2[i])
  print(ans)
b()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
ans=0
for f,r in zip(S,reversed(S)):
  if f==r:
    continue
  else:
    ans+=1
print(ans//2)

Submission status: Accepted

Solution code:
s=input()
c=0
while len(s)>=2:
    if s[0]==s[-1]:
        s=s[1:-1]
    else:
        c+=1
        s=s[1:-1]
print(c)

Submission status: Accepted

Solution code:
S = str(input())
cont = 0
# listに変換
l = [str(x) for x in list(str(S))]
for i in range(int(len(l) / 2)):
    if l[i] == l[len(l) - i - 1]:
        continue
    else:
        cont += 1
print(cont)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

lim = len(s) // 2

count = 0

for i in range(lim):
    if s[i] != s[-1*(i+1)]:
        count += 1
print(count)

Submission status: Accepted

Solution code:
from collections import Counter

s = input()

length = len(s)

x = length // 2
if length % 2:
    f, l = s[:x], s[x+1:][::-1]
else:
    f, l = s[:x], s[x:][::-1]

# print(f, l)

count = 0

for x, y in zip(f, l):
    if x != y:
        count += 1

print(count)

Submission status: Accepted

Solution code:
S = input()

l = len(S)

cnt = 0
for i in range(l // 2):
    if S[i] != S[~i]:
        cnt += 1

print(cnt)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

n=len(s)
cnt=0
for i in range(0,n//2):
    if s[i]==s[n-1-i]:
        continue
    else:
        cnt+=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(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 = list(input())
R = list(reversed(S))

cnt = 0
for x,y in zip(S,R):
  if x != y:
    cnt += 1

print(cnt//2)

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
h = n//2

cnt = 0

for i in range(h):
    if s[i] != s[-(i+1)]:
        
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
S = input()

def kaibun(string):
    count = 0
    strli = list(string)
    for i in range(len(string)//2):
        if strli[i] == strli [-i-1]:
            continue
        else:
            count += 1
    return count

print(kaibun(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())
n=len(s)
l=list(s)
if(n%2==0):
  p=l[0:n//2]
  q=l[n//2:]
else:
  p=l[:n//2]
  q=l[(n//2+1):]
q.reverse()
cnt=0
m=[x for x in range(len(p))]
for num in m:
  if(p[num]!=q[num]):
    cnt+=1
print(cnt)

Submission status: Accepted

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

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:
s = list(input().strip())
ans = len([x for x, y in zip(s, s[::-1]) if x != y]) // 2
print (ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(int(len(S)/2)):
    if S.pop(0) != S.pop(-1):
        count += 1

print(count)

Submission status: Accepted

Solution code:
S = input()
l = len(S)
c = 0
for a, b in zip(S[:l//2+1], S[:l//2-1:-1]):
  if a != b:
    c += 1
print(c)

Submission status: Accepted

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

res //= 2
print(res)

Submission status: Accepted

Solution code:
str = input()
count = 0

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

Submission status: Accepted

Solution code:
S = input()
n = len(S) // 2
c = 0;
for s1, s2 in zip(S[:n], S[-1:n-1:-1]):
    if s1 != s2:
        c += 1
print(c)

Submission status: Accepted

Solution code:
str=input()
s=list(str)
t=s[::-1]

cnt=0
for i,j in zip(s,t):
  if i!=j:cnt+=1
print(cnt//2)

Submission status: Accepted

Solution code:
N = input()

N_r = []

for i in reversed(N):
    N_r.append(i)

res = 0
for i in range(len(N)):
    if N[i] != N_r[i]:
        res += 1

print(res//2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
sr=s[::-1]

n=len(s)
eq=0
neq=0
for i in range(n):
    if s[i]==sr[i]:
        eq+=1
    else:
        neq+=1
        

print(neq//2)

Submission status: Accepted

Solution code:
S = list(input())

ans = 0
if len(S) % 2 == 0:
    l = S[:len(S) // 2]
    r = list(reversed(S[len(S) // 2:]))
    for i in range(len(l)):
        if l[i] != r[i]:
            ans += 1
else:
    l = S[:len(S) // 2]
    r = list(reversed(S[(len(S) // 2)+1:]))
    for i in range(len(l)):
        if l[i] != r[i]:
            ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(str(input()))
 
half_len = int(len(s)/2)
h = s[:half_len]
t = s[-half_len:]
t.reverse()
 
count = 0
for i in range(0, half_len):
  if h[i] != t[i]:
    count = count + 1
print(count)

Submission status: Accepted

Solution code:
import numpy as np

s = list(str(input()))

if len(s) % 2 == 1:
  c = len(s) // 2
  del s[c]

half_len = int(len(s)/2)
h = s[:half_len]
t = s[-half_len:]
t.reverse()

count = 0
for i in range(0, half_len):
  if h[i] != t[i]:
    count = count + 1
print(count)

Submission status: Accepted

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

top=S[0:half]
end=S[half:]
end.reverse()
cnt=0
for i in range(half):
    if top[i]!=end[i]:
        cnt=cnt+1

print(cnt)

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:
#abc147b

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

Submission status: Accepted

Solution code:
#input
S = str(input())

#output
N = len(S)

answer = 0
M = N // 2

for i in range(M):
    if S[i] != S[N-1-i]:
        answer += 1

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
palindrom = list(input())

n = len(palindrom) // 2

ch = 0

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

print(ch)

Submission status: Accepted

Solution code:
S = input()

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

print(cnt)

Submission status: Accepted

Solution code:
# coding: utf-8
from collections import deque
s = deque(input())
tmp = len(s) // 2
cnt = 0
for i in range(tmp):
    if s.pop() != s.popleft():
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
#/usr/bin/env python3

# import sys
# input = lambda: sys.stdin.readline().strip()

S = input()
N = len(S)
V = N // 2

L1 = S[:V]
L2 = S[V:]

count = 0
for i in range(V):
    if L1[i] != L2[-1-i]:
        count += 1
    
print(count)

Submission status: Accepted

Solution code:
S = input()

l = len(S) // 2

left = list(S[:l])
right = list(S[l:][::-1])

# print(left, right)

ans = 0

for l, r in zip(left, right):
    if l != r:
        ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input().strip()
l=int(len(S))
count=0
for i in range(l//2):
    if S[i] !=S[l-i-1]:
        count = count+1

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(S: str):

    Sr = list(S)[::-1]

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

    print(ans//2)

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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:
ss = raw_input()
ss = [s for s in ss]
idx = len(ss) / 2
count = 0
a = ss[:idx]
b = ss[idx * -1:]
for i, (j, k) in enumerate(zip(a, b)):
    if a[i] != b[i * -1 -1]:
        count += 1
print count

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#solve
def solve():
    s = S()
    lens = len(s)+1
    ans = 0
    for i in range(lens // 2):
        if s[i] == s[-i - 1]:
            continue
        ans += 1
    print(ans)

    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
# B - Palindrome-philia
from math import floor
S = str(input())
L = len(S)
l = floor(L / 2)
ans = 0
for i in range(l):
    if S[i] != S[L - i - 1]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
s=input()
n=len(s)//2
cnt=0

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

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()
i=0
lasti=len(S)-1
ans=0
while i<lasti:
  if S[i]!=S[lasti]:
    ans+=1
  i+=1
  lasti-=1
print(ans)

Submission status: Accepted

Solution code:
S = input()
N = len(S) 
s1 = S[:N//2]
s2 = S[N//2:][::-1]

cnt = 0
for i in range(N//2):
    if s1[i] != s2[i]:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

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

Submission status: Accepted

Solution code:
bun = input()
nub = list(reversed(bun))
n = int(len(bun) / 2)

i = hug = 0
while i < n:
    if bun[i] != nub[i]:
        hug += 1
    i += 1
print(hug)

Submission status: Accepted

Solution code:
S =list(map(str, input()))
n=0

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

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
a=s[0:n//2]
b=s[-1:-n//2-1:-1]
ans=0
for c,d in zip(a,b):
  if c!=d:ans+=1
print(ans)

Submission status: Accepted

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