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()

head = S[:len(S)//2]
tail = S[len(S)//2:]

rtail = list(reversed(tail))

diffcount = 0
lhead = list(head)

for i in range(len(lhead)):
    if head[i] != rtail[i]:
        diffcount += 1

print(diffcount)

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
s = input()
num = len(s)
ans = 0
stack = []
for i in range(num//2):
  stack.append(s[i])
if num % 2 == 0:
  t = num//2
else:
  t = num//2 + 1
for i in range(t, num):
  k = stack.pop()
  if k != s[i]:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

s = input()
s_l = list(s)
n = len(s_l)
hugs = 0

for i in range(n):
    tail = n-1-i
    if s_l[i] != s_l[tail]:
        hugs += 1
    if (i == tail) or (tail == i + 1):
        break
    
print(hugs)

Submission status: Accepted

Solution code:


S = input()

rS = list(reversed(S))


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


print(cnt//2)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
s = input().strip()

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

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

print(count)

Submission status: Accepted

Solution code:
INF = float("inf") #const

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

    if n%2==0:
        s1 = s[:n//2]
        s2 = s[n//2:]
        for i in range(n//2):
            if s1[i] != s2[(n//2)-i-1]:
                ans += 1
    else:
        s1 = s[:n//2]
        s2 = s[(n//2)+1:]
        for i in range(n//2):
            if s1[i] != s2[(n//2)-i-1]:
                ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

s = input()
lists = list(s)

count = 0
for i in range(0, math.floor(len(lists)/2)):
    if lists[i] != lists[len(lists)-1-i]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
S = input()

count=0

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

Submission status: Accepted

Solution code:
def palin(s):
    p1 = ans = 0
    p2 = len(s) - 1
    while p1 < p2:
        if s[p1] != s[p2]:
            ans += 1
        p1 += 1
        p2 -= 1
    print(ans)

if __name__ == "__main__":
    import sys
    in_str = ''
    for line in sys.stdin:
        in_str += line
    palin(in_str.strip())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

half = len(S) // 2

cnt = 0
for x in range(0, half):
  if S[x] != S[-x-1] :
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
s = str(input())
s_ = ''.join(list(reversed(s)))

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

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()
l = len(S)
n = l // 2
ans = 0
for i in range(n):
    if S[i] != S[l - i - 1]:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
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:
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()

if len(s)%2 == 0:
    s1 = s[:int(len(s)/2)]
    s2 = ''.join(list(reversed(s[int(len(s)/2):])))
else:
    s1 = s[:int((len(s)-1)/2)]
    s2 = ''.join(list(reversed(s[int((len(s)+1)/2):])))

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

Submission status: Accepted

Solution code:
#coding:utf-8

#data = list(map(int, input().split(" ")))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import heapq
#import itertools
#import math
#import numpy as np
#import sys

S = list(input())
#A,B,C = list(map(int, input().split()))
# S = [input() for _ in range(H)]
# T = [list(map(int,input().split())) for _ in range(N)]
# sys.exit()
ans = 0
if len(S) % 2 == 0 :
    h = int(len(S) / 2)
    s1 = S[0:h]
    s2 =  S[::-1][0:h]
    for i in range(h) :
        if s1[i] != s2[i] :
            ans += 1

else :
    h = int((len(S) - 1) / 2)
    s1 = S[0:h]
    s2 =  S[::-1][0:h]
    for i in range(h) :
        if s1[i] != s2[i] :
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
S = input()
RS = reversed(S)
n = int(len(S) / 2)

ans = 0
for c1, c2 in zip(S[:n], RS):
    if c1 != c2:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    s = input().rstrip()

    if s == s[::-1]:
        print(0)
    else:
        s_len = len(s)//2
        a = s[:s_len]
        b = s[::-1][:s_len]
        ans = 0
        for x, y in zip(a, b):
            if x != y:
                ans += 1

        print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

le = len(s)
count = 0


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

Submission status: Accepted

Solution code:
from sys import stdin 
s = stdin.readline().rstrip()
n = len(s)
m = n // 2
a = 0
for i in range(m):
    if s[i] != s[-i-1]:
        a += 1
print(a)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# a,b,c = map(int, input().split())
S = input()
half_S = int(len(S) / 2)
count = 0
for i in range(half_S):
    if not S[i] == S[(i * -1) - 1]:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
left = []
right = []
if len(s)%2 == 0:
    left = s[:len(s)//2]
    right = s[len(s)//2:]
else:
    left = s[:(len(s)-1)//2]
    right = s[(len(s)+1)//2:]

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

print(ans)

Submission status: Accepted

Solution code:
s = input()

cnt = 0

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

print(int(cnt/2))

Submission status: Accepted

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

S = input()
list_S = list(S)

hug = 0
for i in range(1, int(len(list_S)/2) + 1):
    if list_S[i-1] != list_S[-1 * i]:
        hug += 1

print(hug)

Submission status: Accepted

Solution code:
s = input()
length = len(s)
cnt = 0
if length % 2 == 0:
    f = s[:length // 2]
    l = s[length // 2:]
    lr = l[::-1]

    for i in range(len(f)):
        if f[i] != lr[i]:
            cnt += 1
else:
    f = s[:length // 2]
    l = s[length // 2 + 1:]
    lr = l[::-1]
    # print(f, l)
    for i in range(len(f)):
        if f[i] != lr[i]:
            cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

S = input()
ctr = 0

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

Submission status: Accepted

Solution code:
import sys
bbn=1000000007
	
#+++++
		
def main():
	s = input()
	n=0
	for i,c in enumerate(s[:(len(s)//2)]):
		#pa((c,s[-1*(i+1)]))
		if c != s[-1*(i+1)]:
			n+=1
	
	print(n)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
S = input()
ls1 = []
ls2 = []
ans = 0
if len(S)%2 == 1:
    for i in range(0,(len(S))//2+1):
        ls1.append(S[i])
    for j in range(len(S)//2+1,len(S)):
        ls2.append(S[j])
    ls2.reverse()
    for i in range(len(ls2)):
        if ls1[i] != ls2[i]:
            ans += 1
else:
    for i in range(0,(len(S)//2)):
        ls1.append(S[i])
    for j in range((len(S)//2),len(S)):
        ls2.append(S[j])
    ls2.reverse()
    for i in range(len(ls1)):
        if ls1[i] != ls2[i]:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
s=input()
ans = 0
for i,j in zip(s,reversed(s)):
    if i != j:
        ans += 1
print(ans//2)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()

num = len(S) // 2

if num == 0:
    print(0)
else:
    A = S[0 : num]
    B = list(reversed(S[len(S) - num : ]))
    
    ans = 0

    for a, b in zip(A, B):
        if a != b:
            ans += 1
        
    print(ans)

Submission status: Accepted

Solution code:
S = input()

cnt = 0
mid = len(S) // 2

for c1, c2 in zip(S[:mid], S[-1:mid-1:-1]):
    if c1 != c2:
        cnt += 1

print(cnt)

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


def solve(*args: str) -> str:
    s = args[0]
    hug = 0
    for i in range(len(s)//2):
        if s[i] != s[-i-1]:
            hug += 1

    return str(hug)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Submission status: Accepted

Solution code:
S = input()

N = len(S)
M = N // 2

res = 0

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
a=[]
for i in s[::-1]:
    a+=i
c=0
for i in range(len(s)):
    if s[i]!=a[i]:
        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:
s=str(input())

n=len(s)
if n%2==0:
    s_1=list(s[:n//2])
    s_2=list(s[n//2:])
    s_2=s_2[::-1]

else:
    s_1=list(s[:n//2])
    s_2=list(s[n//2+1:])
    s_2=s_2[::-1]

cnt=0
for i in range(n//2):
    if s_1[i]==s_2[i]:
        continue
    else:
        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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()

count = 0

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

Submission status: Accepted

Solution code:
s = input()


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

Submission status: Accepted

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

m = len(S) // 2
answer = 0

string1 = s[0:m]
string2 = []
for i in range(m):
  string2.append(s[-(i+1)])

for i in range(m):
  if string1[i] == string2[i]:
    pass
  else:
    answer += 1
else:
  print(answer)

Submission status: Accepted

Solution code:
s = input()

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

#print(s1)
#print(s2)
count = 0
for i in range(len(s1)):
    if not s1[i] == s2[i]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
S = list(input())
SS = [S[-i] for i in range(1,len(S)+1)]
s = 0
for i in range(len(S)):
    if S[i] != SS[i]:
        SS[i] = S[i]
        s += 1
print(int(s/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()

sc = int(len(s)/2)
c=0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if len(s) % 2 == 0:
  s_len = len(s) // 2
else:
  s_len = len(s) // 2 + 1

cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def main():
    s = input()
    t = len(s)//2
    ls = s[:t]
    rs = None
    c = 0
    if len(s)%2==0:
        rs = s[t:]
    else:
        rs = s[t+1:]
    rs = rs[::-1]
    #print(ls,rs)
    for l,r in zip(ls,rs): 
        if l != r:
            c += 1
    print(c)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
l = list(input())

ans = 0

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

Submission status: Accepted

Solution code:
s = str(input())

s_inv = s[::-1]

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

Submission status: Accepted

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

count = 0
for i in range(h) :
  a1 = s[i]
  a2 =s[-1+(-i)]
  
  if a1 != a2 : 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:
# coding:utf-8

S = input()

half = S[0:len(S)//2]
cnt = 0

for i in range(len(half)):
    if half[i] != S[-(i+1)]:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = input()
hag = 0

l = len(s) // 2
for h, t in zip(s[0:l], (s[::-1])[0:l]):
    if h != t:
        hag += 1
print(hag)

Submission status: Accepted

Solution code:

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
a = list(stdin.readline().rstrip())
num = int(len(a) / 2)
res = 0
for el in range(num):
    f = a[el]
    b = a[len(a) - 1 - el]
    if not f == b:
        res += 1
print(res)

Submission status: Accepted

Solution code:
S = input()

hagu = 0

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

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

print(hagu)

Submission status: Accepted

Solution code:
S = input()

length = len(S)
tmp = S[length // 2:]
cnt = 0
for i, e in enumerate(S[:length // 2:]):
    if tmp[::-1][i] == e:
        continue
    else:
        cnt +=1
print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	S = input()
	S = S[:-1]

	tmp = len(S)
	tmp = tmp // 2

	ans = 0
	for i in range(tmp):
		#print("{} {}".format(S[i], S[-1 * (i+1)]))
		if S[i] == S[-1 * (i+1)]:
			pass
		else:
			ans += 1

	print(ans)


if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import math

S = input()

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

print(count)

Submission status: Accepted

Solution code:
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think('redcoder'), 1)

    def test_2(self):
        self.assertEqual(think('vvvvv'), 0)

    def test_3(self):
        self.assertEqual(think('abcdabc'), 2)


def solve():
    s = read()
    result = think(s)
    write(result)


def read():
    return read_line()


def read_int(n):
    return read_type(int, n)


def read_float(n):
    return read_type(float, n)


def read_type(t, n):
    return list(map(lambda x: t(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(data):
    mid = len(data) // 2 - 1

    left = 0
    right = len(data) - 1
    count = 0
    while left <= mid:
        count += 0 if data[left] == data[right] else 1
        left += 1
        right -= 1
    return count


def write(result):
    print(result)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

count = 0

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

Submission status: Accepted

Solution code:
# B - Palindrome-philia
S = str(input())
N = len(S)
count = 0
for i in range(N//2):
    if S[i] == S[(N-1)-i]:
        pass
    else:
        count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

s=input()

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

if len(s)%2==0:
    left = s[:len(s)//2]
    right = s[len(s)//2:][::-1]
else:
    left = s[:(len(s)-1)//2]
    right = s[(len(s)-1)//2+1:][::-1]

ans = 0
for i in range(len(left)):
    if left[i]!=right[i]:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
S = input()
c = len(S)
if c % 2 == 0:
    A1 = S[:c//2]
    A2 = S[c//2:]
    A2 = A2[::-1]
else:
    A1 = S[:c//2]
    A2 = S[c//2+1:]
    A2 = A2[::-1]

ans = 0
for i in range(len(A1)):
    if A1[i] != A2[i]:
        ans += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S=input()

s_rev = S[::-1]

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

print(ans//2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

s = input()
n = len(s)//2

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

print(res)

Submission status: Accepted

Solution code:
import sys


def main():
    s = sys.stdin.readline().strip()

    n = len(s)
    # n: 3, half: 2
    # n: 4, half: 2
    # n: 5, half: 3
    half = n // 2 + (n % 2)

    ans = 0
    for i in range(half):
        if s[i] != s[-1-i]:
            ans += 1
    print(ans)


main()

Submission status: Accepted

Solution code:
S = str(input())
# if len(S) % 2 == 0:
mid = len(S)//2
left = S[:mid]
right = S[mid:]
ans = 0
# print(left)
# print(right)
for i in range(mid):
    # print(left[i])
    # print(right[-(i+1)])
    if left[i] != right[-(i+1)]:
        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:
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

s = input()
cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

MOD = 10**9 + 7
INF = 10**20
I = lambda:list(map(int,input().split()))
from collections import defaultdict as dd

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

Submission status: Accepted

Solution code:
# b
s = input()
if len(s) % 2 ==0:
    s_m = s[:int(len(s) / 2)]
    s_u = s[int(len(s) / 2):][::-1]
else:
    s_m = s[:int(len(s) / 2)]
    s_u = s[int(len(s) / 2) + 1:][::-1]
    
count = 0
for i in range(len(s_m)):
    if s_m[i] != s_u[i]:
        count += 1
print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

cn=0

if le%2==0:
    for i in range(int(le/2)):
        if s[i]!=s[le-1-i]:
            cn=cn+1

if le%2==1:
    for i in range(int(le/2)):
        if s[i]!=s[le-1-i]:
            cn=cn+1

print(cn)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

def main():
    S = input()
    logging.info("Hello!")

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

    print(counter)
    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

print(cnt)

Submission status: Accepted

Solution code:
s = input()

n = len(s)
s1 = s[:n//2]
s2 = s[-(n//2):]
# print(s1)
# print(s2)

s3 = list()
for i in reversed(range(len(s2))):
    s3.append(s2[i])
s3 = ''.join(s3)
s2 = s3
cnt = 0

for i in range(len(s1)):
    if s1[i] != s2[i]:
        cnt += 1
print(cnt)

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()
ans = 0

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

print(ans)

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:
S = input()
S_size = len(S)

if S_size % 2 == 0:
    S_left = list(S[: S_size//2])
    S_right = list(reversed(S[S_size//2 :]))
else:
    S_left = list(S[: S_size//2])
    S_right = list(reversed(S[(S_size//2 + 1) :]))

counter = 0
for i in range(len(S_left)):
    if S_left[i] == S_right[i]:
        pass
    else:
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
import sys
import math
import bisect
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


# A
def A():
    a, b, c = LI()
    if a + b + c >= 22:
        print("bust")
    else:
        print("win")
    return


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


# C
def C():
    return


# D
def D():
    return


# E
def E():
    return


# F
def F():
    return


# Unittest
def resolve():
    B()
    return


# Solve
if __name__ == "__main__":
    B()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
S = input()
count = 0

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

print(count)

Submission status: Accepted

Solution code:
# B
s = input()
leng = len(s)
if leng%2==0:
    mae = s[:leng//2]
    ushi = s[leng//2:][::-1]
else:
    mae = s[:leng//2]
    ushi = s[leng//2+1:][::-1]

hagu = 0
for m, u in zip(mae, ushi):
    if m != u:
        hagu += 1
print(hagu)

Submission status: Accepted

Solution code:
s = input()

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

print(count)

Submission status: Accepted

Solution code:
def main():
    # input
    import math
    s = input()

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



    # calc


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)