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

len_s = len(s)
if len_s == 1:
  print(0)
else:
  l = len_s // 2
  top, end = s[0:l], s[::-1][0:l]
  print(sum([(0 if t == e else 1) for t, e in zip(top, end)]))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

    split = len(S) // 2

    S = S[:split]
    rev_S = rev_S[:split]

    count = 0

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

    print(count)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

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

Submission status: Accepted

Solution code:
s = input()

nagasa = len(s)

zen = s[0:nagasa//2]
kou = s[nagasa//2:nagasa][::-1]
count = 0
for i in range(len(zen)):
    if zen[i] != kou[i]:
        count += 1
    else:
        continue
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

line = input()
count = 0
leng = int(len(line) / 2)

for i in range(leng):
    if line[i] != line[-1*(1+i)]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
# 偶数チェック
def Even(n):
    if n%2 == 0:
        return True
    else:
        return False
    

S = list(input())

s1 = []
s2 = []

if Even(len(S)):
    s1 = S[:int(len(S)/2)]
    s2 = S[int(len(S)/2):]
    s2.reverse()
else:
    s1 = S[:int(len(S)//2)]
    s2 = S[int(len(S)//2)+1:]
    s2.reverse()

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

Submission status: Accepted

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


if __name__ == "__main__":
    Palindrome_philia()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
s = list(input())
n = len(s)
ans = 0
if n % 2 == 0:
    sf = s[0:int(n/2)]
    sb = s[int(n/2):]
    sb_r = sb[::-1]
    #print(sf, sb_r)
    for i in range(0, int(n/2)):
        if sf[i] != sb_r[i]:
            ans += 1
else:
    sf = s[0:int(((n-1)/2))]
    sb = s[int(((n-1)/2)+1):]
    sb_r = sb[::-1]
    #print(sf, sb_r)
    for i in range(0, int((n-1)/2)):
        if sf[i] != sb_r[i]:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
def main():
	s = list(str(input()))
	# half = int(len(s)) // 2
	# print(s[0:half])
	ans = 0
	if len(s) % 2 == 0:
		half = int(len(s)) // 2
		sf = s[0:half]
		sl = s[half:int(len(s))]
		sl.reverse()
		# print(len(sf))
		# print(sf,sl)
		for i in range(len(sf)):
			if sf[i] == sl[i]:
				ans += 0
			else:
				ans += 1
	else:
		half = int(len(s)) // 2 + 1
		sf = s[0:half-1]
		sl = s[half:]
		sl.reverse()

		# print(sf,sl)
		for i in range(len(sf)):
			if sf[i] == sl[i]:
				ans += 0
			else:
				ans += 1

	print(ans)

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
S = input()
LIST = list(S) #リストにすると、1文字毎に分割される。
lengs = len(LIST) #リス

count = int(0)

c = lengs // 2 


#中央は回文に必要ない要素なので処理しなくてもよい。

for i in range(c):
    #print(LIST[i])
    #print(LIST[lengs-i-1])
    #print("ばばばば")
    if LIST[i] == LIST[lengs-i-1]:
        count = count
    else:
        count = count  + 1
   
print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
from sys import stdin


def main():
    # コンソール入力を受け取る
    S = stdin.readline().rstrip()
    front = S[:int(len(S) / 2)]
    back = S[-int(len(S) / 2):][::-1]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

ans = 0
i = 0
while i < len(s) // 2:
  # print(s[i],s[-i-1])
  if s[i] != s[-i-1]:
    ans += 1
  
  i += 1

print(ans)

Submission status: Accepted

Solution code:
S=input()
ans=0
cnt=len(S)-1
for i in range(cnt):
  if (i>=cnt):
    break
  else:
    if (S[i]!=S[cnt]):
      ans=ans+1
    cnt=cnt-1
print(ans)

Submission status: Accepted

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

s = stdin.readline().strip()
sl = len(s)

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

print(cnt)

Submission status: Accepted

Solution code:
s = input()
t = s[::-1]
times = 0

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

print(int(times/2))

Submission status: Accepted

Solution code:
import math

S = input()

h1 = math.ceil(len(S)/2)
h2 = math.floor(len(S)/2)

s1 = S[:h1]
s2 = S[h2:][::-1]

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

Submission status: Accepted

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

S_pre = S[:int(len(S)/2)]
if len(S) % 2  == 0 : # 偶数
	S_aft = S[int(len(S)/2):]
else: # 奇数
	S_aft = S[int(len(S)/2)+1:]
S_aft.reverse() # 逆順
count = 0
for i in range(len(S_pre)):
	if S_pre[i] != S_aft[i]:
		count += 1

print(count)

Submission status: Accepted

Solution code:
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

s = list(input())
n = len(s)
if n%2==0:
    l = s[0:len(s)//2]
    r = s[len(s)//2:len(s)]
else:
    l = s[0:n//2]
    r = s[n//2+1:n]

r.reverse()
ans=0
for i in range(n//2):
    if l[i]!=r[i]:
        ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(0, l):
    j = l - i - 1
    if (i >= j):
        break
    if (s[i] != s[j]):
        ans += 1

print(ans)

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

c = 0

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

Submission status: Accepted

Solution code:
s = list(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)
M= int(N/2)
j=0
list=[c  for c in S]
for i in range(M):
    if list[i]!=list[-(i+1)]:
        j+=1
print(j)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def main():
  S=input()
  count = 0
  if len(S) % 2:	#kisuu
    for i in range(len(S) // 2):
      if S[i] == S[len(S)-i-1]:
        a=0
      else:
        count = count + 1
  else:
    for i in range(len(S) // 2):
      if S[i] == S[len(S)-i-1]:
        a=0
      else:
        count = count + 1
  print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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=str(input())
#k=len(s)//2
c=0
p=len(s)
k=p//2
for i in range(k):
    if s[i]!=s[p-i-1]:
        c+=1
print(c)

Submission status: Accepted

Solution code:
s = list(str(input()))
ans = 0
slen = len(s)
if len(s) % 2 == 1:
    pres = s[0:len(s)//2]
    lass = s[len(s)//2+1:slen]
else:
    pres = s[0:len(s)//2]
    lass = s[len(s)//2:slen]
lass=lass[::-1]
for i in range(slen//2):
    if pres[i] == lass[i]:
        pass
    else:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
s=str(input())
l=len(s)
a=list(s)

t=0
for i in range(l//2):
    if not a[i]==a[-1-i]:
        t +=1

print(t)

Submission status: Accepted

Solution code:
s = input()
a = []
b = []
cnt = 0
if len(s)%2 == 0:
    a = list(s[:int(len(s)/2)])
    b = list(s[int(len(s)/2):])
else:
    a = list(s[:int((len(s)-1)/2)])
    b = list(s[int((len(s)+1)/2):])
b.reverse()
for i in range(len(a)):
    if a[i] != b[i]:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
s=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:
ans = 0
str = input()
rev = ''.join(reversed(str))
for i in range(len(str)):
    if str[i] == rev[i]:
        continue
    else:
        ans += 1
ans = int(ans/2)
print(ans)

Submission status: Accepted

Solution code:
S = input()

num = len(S)
half = num // 2

if num % 2 == 0:
    mae = S[:half]
    ushiro = S[half:]
else:
    mae = S[:half]
    ushiro = S[half+1:]

cnt = 0
for i in range(half):
    j = (half-1) - i
    if mae[i] != ushiro[j]:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
s = input()
n = int(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())
len_S = len(S)
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 = list(input())

# 左半分と右半分で違う文字の個数 = 変更必要な文字数
count = 0
harf = int(len(s_list) // 2)
for i in range(harf):
  if s_list[i] != s_list[len(s_list)-i-1]:
    count += 1
print(count)

Submission status: Accepted

Solution code:
import sys

s = sys.stdin.read().strip()
c = 0
l = len(s)
for i in range(int(l/2)):
  if s[i] != s[l-i-1]:
    c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = 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:
from sys import stdin


def main():
    S = input()
    new_S = ''.join(list(reversed(S)))
    sum_ = 0

    for i in range(len(S)):
        if not S[i] == new_S[i]:
            sum_ += 1

    print(sum_//2)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
s = list(S)
l = len(s)
ans = 0

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

Submission status: Accepted

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

t = s[::-1]

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

print(int(count / 2))

Submission status: Accepted

Solution code:
import sys
s = list(input())
ans = 0
# print(s)
if len(s) == 1:
    print(0)
    sys.exit()

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

Submission status: Accepted

Solution code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n,m):
    return int(n*m/gcd(n,m))

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

from operator import mul
from functools import reduce

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

import random


def main():
    S = input().strip()
    # eprint(S[0])
    n=len(S)
    cnt1=0
    for i in range(0,n//2):
        # eprint("i ",end=": ")
        # eprint(i)
        # eprint("S[i], S[-i] ",end=": ")
        # eprint(S[i], S[-(i+1)])
        if S[i]!=S[-(i+1)]:
            # eprint(S[i])
            cnt1+=1
    print(cnt1)
    # cnt2=0
    # for i in range(2/n,n):
        
    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

s = str(input())
n = math.ceil(len(s)/2)

count = 0

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

print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
A = list(input())
N = len(A)
F = N-1
s = 0
if N%2 == 0:
    for i in range(int(N/2)):
        if A[i] != A[N-1-i]:
            s = s+1
else:
    for j in range(int(F/2)):
    
        if A[j] != A[N-1-j]:
            s = s+1
            
print(s)

Submission status: Accepted

Solution code:
input_str = input()
head = input_str[:len(input_str) // 2]
tail = input_str[:(len(input_str)-1) // 2:-1]

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

print(ans)
exit(0)

Submission status: Accepted

Solution code:
s = str(input())

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

print(ans)

Submission status: Accepted

Solution code:
a = input()

i = 0
j = len(a) - 1

res=0
while i <= j:
    if a[i] != a[j]:
        res += 1
    
    i += 1
    j -= 1

print(res)

Submission status: Accepted

Solution code:
line = input()
counter = 0
for iter in range((len(line)+1)//2):
    if line[iter] != line[-(iter+1)]:
        counter += 1
print(counter)

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 == 0:
    S1 = S[:int(len(S)/2)]
    S2 = S[int(len(S)/2):]
else:
    S1 = S[:int((len(S)/2))]
    S2 = S[int((len(S)/2)+1):]

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

print(count)

Submission status: Accepted

Solution code:
S = list(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)+1)//2:]    

res = 0
for i in range(len(S1)):
    if S1[i] != S2[-1*(i+1)]:
        res +=1

print(res)

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 != 0:
    middle = len(S) // 2
    S = S[:middle] + S[middle + 1:]

half_S = int(len(S)/2)

first_S = S[:half_S]
second_S = S[half_S:]
second_S = second_S[::-1]

count = 0
for i in range(len(first_S)):
    if first_S[i] != second_S[i]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
S = input()

harf_n = len(S)//2
befor_str = S[:harf_n]
after_str = reversed(S[harf_n:])

hug_count = 0
for b_str, a_str in zip(befor_str, after_str):
    if b_str != a_str:
        hug_count += 1
print(hug_count)

Submission status: Accepted

Solution code:
S = str(input())
n = len(S)
RS = str(S)[::-1]
cnt = 0

for i in range(n//2):
  if S[i] != RS[i]:
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
# 文字列の入力
S = str(input())
#入力文字列Sの文字数の半分の情報を取得
half = 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:
from collections import deque
import sys
input = sys.stdin.readline

def main():
    d = deque(list(input().strip('\n')))
    c = 0
    while len(d) > 1:
        if d.popleft() != d.pop():
            c += 1
    print(c)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
count = 0
while len(S)>=2:
    #print(len(S))
    #print(S)
    if S[0] == S[-1]:
        del S[0]
        del S[-1]
    else:
        del S[0]
        del S[-1]   
        count += 1
print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())

S_list = list(S)

S_len = len(S_list)

counter = 0

for n in range(int(S_len / 2)):
    if(S_list[n] != S_list[S_len - n - 1]):
        counter += 1
    else:
        pass

print(counter)

Submission status: Accepted

Solution code:
S = input()
S_length = len(S)
half_length = int(S_length/2)
hug_count = 0
for i in range(half_length):
    if S[i] == S[S_length-i-1]:
        pass
    else:
        hug_count += 1
print(hug_count)

Submission status: Accepted

Solution code:
string = input()

hug = 0

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

print(hug)

Submission status: Accepted

Solution code:
import math

s = input()
leng = math.floor(len(s)/2)

sa = list(s[:leng])
sb = ''.join(s[::-1])
sb = list(sb[:leng])

result = 0
for i in range(leng):
    if not sa[i]==sb[i]:
        result += 1
print(result)

Submission status: Accepted

Solution code:
S = input()

cnt = 0

for s, sr in zip(S,S[::-1]):
  if s != sr:
    cnt += 1

print(cnt//2)

Submission status: Accepted

Solution code:
S = input()
half = len(S) // 2
former = S[:half]
latter = S[half:] if len(S) % 2 ==0 else S[half + 1:]

ans = 0
for f, l in zip(former, latter[::-1]):
  if f != l: ans += 1

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/python

import sys

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

    print(count)

if __name__ == '__main__':
    s = sys.stdin.readline().strip()
    solve(s)

Submission status: Accepted

Solution code:
S = input()

s1 = S[0:len(S)//2]
s2 = S[len(S)//2:]

hug = 0
for i in range(len(s1)):
    if s1[i] == s2[-(i+1)]:
        pass
    else:
        hug += 1
print(hug)

Submission status: Accepted

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

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:
import math

s = input()

goal = math.floor(len(s) / 2) 

ans = 0
for num in range(0, goal):
    # print(s[num])
    # print(s[(num + 1) * -1])
    if s[num] != s[(num + 1) * -1]:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
def main():
    input_sentence = input().split(" ")[0]
    input_len = len(input_sentence)
    count = 0
    half_ind = input_len//2
    front_st = input_sentence[:half_ind]
    back_st = input_sentence[half_ind:][::-1]
    for (f, b) in zip(front_st, back_st):
        if f != b:
            count += 1
    print(count)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
ct = 0
n = len(s)
l = list(s)

for i in range(int((n+1)/2)):
    if l[i] == l[n-1-i]:
        continue
    else:
        l[n-1-i] = l[i]
        ct += 1

print(ct)

Submission status: Accepted

Solution code:
from operator import ne
S=input()
n=len(S)
print(sum(map(ne,S[:n//2],S[n//2:][::-1])))

Submission status: Accepted

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

pre = s[:h]
#print(pre)
if l % 2 == 0:
  rear = s[h:]
else:
  rear = s[h+1:]
#print(rear)
rear_rev = ''.join(list(reversed(rear)))
#print(rear_rev)

for i in range(len(pre)):
  if pre[i] != rear_rev[i]:
    ans += 1

print(ans)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
S = str(input())

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

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    S = input()

    a = 0
    for i in range(len(S) // 2):
        if S[i] == S[(i + 1) * -1]:
            continue
        else:
            a += 1

    print(a)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC147 B
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
s = si()
n = len(s)
# s_rev = s[::-1]
# print(s_rev)
# print(s[n-1:n])
ans = 0
for i in range(n//2):
    if s[i:i+1]!=s[n-1-i:n-i]:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
s=list(input())
#print(s)
l=s[::-1]
#print(l)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S = input()

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
s = list(str(input()))
s1 = s[:len(s)//2]
s2 = list(reversed(s))[:len(s)//2]

ans = 0

for _s1, _s2 in zip(s1, s2):
    if _s1 == _s2:
        pass
    else:
        ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

if len(S) % 2 == 0:
    num1 = len(S)//2
    num2 = len(S)//2
else:
    num1 = len(S)//2 +1
    num2 = len(S)//2

first = S[:num1]
second = S[num2:]
# print(first, second)

cnt = 0
for i in range(num1):
    # print(first[i], second[-(1 +i)])
    if first[i] != second[-(1+i)]:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = list(input())
i=0
j=len(n)-1
m=0

for c in n:
  if i >= j:
    print(m)
    exit()
  if c != n[j]:
    m += 1
  i += 1
  j -= 1
print(m)

Submission status: Accepted

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

if len(S)%2 == 1:
    t = len(S)//2
    for i in range(t,-1,-1):
        ans.append(S[i])
    for i in range(t+1):
        if S[i+t] != ans[i]:
            c += 1
    print(c)

Submission status: Accepted

Solution code:
a = input()

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

print(cnt)

Submission status: Accepted

Solution code:
n = input()
index = 0
count = 0

while True:
    if len(n) / 2 <= index:
        break
    if n[index] != n[(index*-1) - 1]:
        count += 1
    index += 1
print(count)

Submission status: Accepted

Solution code:
a = raw_input()
l = len(a)
count = 0
for i in range(int(l/2)):
    letter = a[i]
    if letter == a[-i-1]:
      continue
    else:
      count += 1
print(count)

Submission status: Accepted

Solution code:
s = str(input())

if len(s) % 2 == 0:
    fore = s[:len(s)//2]
    back = s[len(s)//2:]
else:
    fore = s[:len(s)//2]
    back = s[len(s)//2+1:]

rback = list(reversed(back))
fore = [s for s in fore]

count = 0
for rb, fo in zip(rback, fore):
    if rb != fo:
        count += 1

print(count)

Submission status: Accepted

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

cnt = int(cnt/2)
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
kaibun = input()
count = 0
lenstr = len(kaibun)

if lenstr%2 ==0:
  left = kaibun[:int(lenstr/2)]
  right = kaibun[int(lenstr/2):]
else:
  left = kaibun[:math.floor(lenstr/2)]
  right = kaibun[math.floor(lenstr/2):]

for i in range(len(left)):
  back = -1 * i -1
  if left[i] != right[back]:
    count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8
# n,k = int(input())
# list = list(map(int,input().split()))
# strings = list(map(str, [input() for i in range(amount)]))

s = input()
hug = 0

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

print(hug)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def palindrome(string):
    return string.find(string[::-1])

s = input()
s_sum = 0
s_list1 = []
s_list2 = []

for i in range(len(s)):
    s_list1.append(s[i])

s_list2 = s_list1[::-1]

for i in range(len(s)):
    if s_list1[i] != s_list2[i]:
        s_sum += 1

print(s_sum // 2)

Submission status: Accepted

Solution code:
s=input()

r=len(s)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

A = []
for i in S:
    A.append(i)
ans = 0
S.reverse()
for i in range(len(S)):
    if S[i] != A[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[len(s)-1-i]:
        c+=1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

ans = 0

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

Submission status: Accepted

Solution code:
S = input()
ans = 0
if len(S)%2 ==0:
    s1 = list(S[:len(S)//2])
    s2 = list(S[len(S)//2:])
    s2.reverse()

else:
    s1 = list(S[:len(S)//2 + 1])
    s2 = list(S[len(S)//2 : ])
    s2.reverse()

for a1, a2 in zip(s1, s2):
    if a1 != a2:
        ans += 1
print(ans)