Problem:


回文

半角アルファベット文字列からなる、1 行あたり 100 文字以内のデータがあります。いくつかの行は対称（左端から読んでも右端から読んでも同じ）です。このデータを読み込んで、その中の対称な文字列の数を出力するプログラムを作成してください。なお、１文字だけからなる行は対称であるとします。

Input

複数の文字列が複数行にわたって与えられます。各行に１つの文字列が与えられます。文字列の数は 50 を超えません。

Output

対称な文字列の数を１行に出力します。

Sample Input

abcba
sx
abcddcba
rttrd

Output for the Sample Input

2



Sample input:
abcba
sx
abcddcba
rttrd


Sample output:
2

Submission status: Wrong Answer

Solution code:
res = 0
while True:
    try:
        cc = list(input())
        if not len(cc):
            break
    except:
        break
    l = len(cc)
    if l % 2 == 0:
        if cc[:l // 2] == cc[:l // 2 - 1:-1]:
            res += 1
    else:
        if cc[:(l + 1) // 2] == cc[:(l - 1) // 2 - 1:-1]:
            res += 1
print(res)

Submission status: Wrong Answer

Solution code:
res = 0
while True:
    try:
        cc = list(input())
    except:
        break
    l = len(cc)
    if l % 2 == 0:
        if cc[:l // 2] == cc[:l // 2 - 1:-1]:
            res += 1
    else:
        if cc[:(l + 1) // 2] == cc[:(l - 1) // 2 - 1:-1]:
            res += 1
print(res)

Submission status: Wrong Answer

Solution code:
import sys
print(e[:-1]==e[-2::-1]for e in sys.stdin)

Submission status: Wrong Answer

Solution code:
import sys

c = 0
for s in sys.stdin:
	if s == s[::-1]:
		c += 1
print c

Submission status: Wrong Answer

Solution code:
while True:
    try:
        flag, count = 1, 0
        a = raw_input()
        if len(a) == 1:
            count += 1
        else:
            for i in range(len(a)/2):
                if a[i] != a[len(a)-1-i]:
                    flag = 0
                    break
            if flag == 1:
                count += 1    
    except:
        break
print count

Submission status: Wrong Answer

Solution code:
count = 0
while True:
    try:
        a = raw_input()
        count += 1
        if len(a) > 1:
            for i in range(len(a)/2):
                if a[i] != a[len(a)-1-i]:
                    count -= 1   
    except:
        break
print count

Submission status: Wrong Answer

Solution code:
ct = 0
try:
    while True:
        s = raw_input()
        if s[:(len(s) + 1) / 2] == s[-1:len(s) / 2 - 1:-1]:
            ct += 1
except EOFError:
    pass
print ct

Submission status: Time Limit Exceeded

Solution code:
count = 0
while True:
    try:
        s_lis1 = list(raw_input())
        s_lis2 = s_lis1[:]
        s_lis2.reverse()
        if s_lis1 == s_lis2:
            count += 1
    except EOFError:
        print count

Submission status: Accepted

Solution code:
import sys
print(sum(s[:-1]==s[-2::-1]for s in sys.stdin))

Submission status: Accepted

Solution code:
import sys

cnt = 0
for s in sys.stdin:
    s = s[:-1]
    l = len(s)
    for i in xrange(l/2+1):
        if s[i] != s[l-i-1]: break
    else: cnt += 1
print cnt

Submission status: Accepted

Solution code:
import sys
f = sys.stdin


def is_symmetry(s):
    return s == s[::-1]

print(sum(1 for line in f if is_symmetry(line.strip())))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Copyright  : @Huki_Hara
# Created    : 2015-03-16

def ch(l):
    for i in range(len(l) // 2):
        if l[i] != l[-i-1]:
            return False
    return True

s = 0
while True:
    try:
        l = input()
    except:
        break

    if ch(l):
        s += 1
print(s)

Submission status: Accepted

Solution code:
def is_kaibun(word):
    for i in range(len(word)):
        if 2*i < len(word):
            if word[i] == word[len(word)-i-1]:
                continue
            else:
                return False
                break
        elif 2*i == len(word):
            return True
            break
    else:
        return True
    
s = []
while True:
    try:
        s.append(raw_input())
    except EOFError:
        break

tot = 0
for word in s: 
    if is_kaibun(word):
        tot += 1
print tot

Submission status: Accepted

Solution code:
c = 0
try:
	while 1:
		s = raw_input()
		if s[::-1] == s:
			c += 1
except:
	pass

print c

Submission status: Accepted

Solution code:
count = 0
while True:
    try:
        s_lis1 = list(raw_input())
        s_lis2 = s_lis1[:]
        s_lis2.reverse()
        if s_lis1 == s_lis2:
            count += 1
    except EOFError:
        print count
        break

Submission status: Accepted

Solution code:
import sys
count = 0
for line in sys.stdin.readlines():
  l = [i for i in line.replace('\n','')]
  m = list(l)
  l.reverse()
  if m == l:
    count += 1
print(count)

Submission status: Accepted

Solution code:
from math import *
PI = 3.1415926535898
ans = 0
while True:
    try:
        n = raw_input()
        if n == n[::-1]:
            ans += 1
    except EOFError:
        break
print ans

Submission status: Accepted

Solution code:
ans=0
while 1:
    try:
        n=raw_input()
        if n==n[::-1]:
            ans+=1
    except:
        break
print ans

Submission status: Accepted

Solution code:
cnt=0
while True:
	try:
		line = input()
		if line[0:]==line[::-1]:
			cnt+=1

	except EOFError:
		break

print(cnt)

Submission status: Accepted

Solution code:
#encoding=utf-8

import sys
count = 0
for line in sys.stdin:
    word = line[:-1]
    if word == word[::-1]: count += 1
print count

Submission status: Accepted

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

import sys

def is_pal(s):
    l = len(s)-1
    for i in range(l/2):
        if s[i] != s[l-1-i]:
            return False
    return True

count = 0
for line in sys.stdin:
    if is_pal(line):
        count += 1
print count

Submission status: Accepted

Solution code:
count = 0
try:
    while 1:
        a = raw_input()
        b = a[::-1]
        if a == b: count+=1
except EOFError: pass
print count

Submission status: Accepted

Solution code:
res = 0
while True:
    try:
        cc = list(input())
        if not len(cc):
            break
    except:
        break
    l = len(cc)
    if l == 1:
        res += 1
    elif l % 2 == 0:
        if cc[:l // 2] == cc[:l // 2 - 1:-1]:
            res += 1
    else:
        if cc[:(l + 1) // 2] == cc[:(l - 1) // 2 - 1:-1]:
            res += 1
print(res)

Submission status: Accepted

Solution code:
num = 0
while True:
    try:
        moji = input()
        if moji == moji[::-1]:
            num += 1
    except EOFError:
        print(num)
        break

Submission status: Accepted

Solution code:
import sys

s = []
for line in sys.stdin:
    line = line.strip()
    if line == line[::-1]:
        s.append(line)
print(len(s))

Submission status: Accepted

Solution code:
cnt = 0
while True:
    try:
        s = input()
    except:
        break
    if s == s[::-1]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
a=0
while 1:
    try:s=input()
    except:break
    if s==s[::-1]:a+=1
print(a)

Submission status: Accepted

Solution code:
ans = 0
while True:
    try:
        S = input()
    except EOFError:
        break
    ok = True
    for i in range(0,len(S) // 2):
        if S [i] != S [len(S) - i - 1]:
            ok = False
    if ok:
        ans += 1

print(ans)

Submission status: Accepted

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

import sys
import os

counter = 0
for s in sys.stdin:
    s = s.strip()
    if s == s[::-1]:
        counter += 1
print(counter)

Submission status: Accepted

Solution code:
count = 0
while True:
    try:
        s = input()
    except EOFError:
        break
 
    if all(s[i] == s[-1-i] for i in range(len(s)//2+1)):
        count += 1
 
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0063
"""
import sys



def is_palindrome(txt):
    rev = txt[::-1]
    if txt == rev:
        return True
    else:
        return False



def main(args):
    count = 0
    for line in sys.stdin:
        txt = line.strip()
        if is_palindrome(txt):
            count += 1
    print(count)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
# Aizu Problem 0063: Palindrome
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


cnt = 0
while True:
    try:
        string = input().strip()
    except EOFError:
        break
    if string == string[::-1]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys

count = 0
for line in sys.stdin:
  try:
    if line == '\n' or line == '\r':
      break
    line = line.strip()
    condition = True
    for i in range(len(line) // 2):
      if line[i] != line[-(i+1)]:
        condition = False
        break
    if condition:
      count += 1
  except:
    break
print(count)

Submission status: Accepted

Solution code:
ans=0
while True:
    try:
        b = input()
        a = list(b)
        c=len(a)
        if c==0:
            break
        c=int(c/2)
        e=0
        for i in range(c):
            d=i+1
            if a[i]==a[-d]:
                e+=1
            else:
                break
        if e==c:
            ans+=1
    except:
        break
print(ans)

Submission status: Accepted

Solution code:
i = 0
while True:
    try:
        s = input()
        if s == s[::-1]:
            i += 1
    except:
        print(i)
        break

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
ans = 0
for ll in range(len(N)):
    S = N[ll]
    flag = True
    for i in range(len(S) // 2):
        if S[i] != S[len(S)-i-1]:
            flag = False
            break
    if flag:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
print(sum(e[:-1]==e[-2::-1]for e in sys.stdin))

Submission status: Accepted

Solution code:
ans = 0
while True:
  try:
    s = input()
    if s == s[::-1]:
      ans += 1

  except EOFError:
    break

print(ans)

Submission status: Accepted

Solution code:
import sys
print(sum([1 for i in sys.stdin if i.strip()==i.strip()[::-1]]))

Submission status: Accepted

Solution code:
# AOJ 0063 Palindrome
# Python3 2018.6.15 bal4u

ans = 0
while True:
	try:
		s = str(input())
		if s == s[::-1]: ans += 1
	except EOFError: break
print(ans)

Submission status: Accepted

Solution code:
ans=0
while True:
	try:
		s=raw_input()
		if s==s[::-1]:
			ans+=1
	except EOFError:
		print ans
		break

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

import sys

def get_answer(params):
    palindrome_count = 0
    for param in params:
        if param == param[::-1]:
            palindrome_count += 1
    return palindrome_count


def main():
    params = [line.rstrip() for line in sys.stdin.readlines()]
    print get_answer(params)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
print sum([1 for line in map(lambda x:x.strip(),sys.stdin.readlines()) if line==line[-1::-1]])

Submission status: Accepted

Solution code:
import sys
print sum([1 for line in map(lambda x:x.strip(),sys.stdin.readlines()) if line==line[::-1]])

Submission status: Accepted

Solution code:
import sys
c=0
for l in sys.stdin:
    a=l.rstrip()
    if a==a[::-1]:
        c+=1
print c

Submission status: Accepted

Solution code:

import sys


def is_palindrome(s):
    l1 = list(s)
    l2 = list(s)
    l2.reverse()
    if l1 == l2:
        return True
    else:
        return False


n = 0
for line in sys.stdin:
    s = line.rstrip()
    if is_palindrome(s):
        n += 1
print n

Submission status: Accepted

Solution code:
n = 0
while 1:
    try:
        a = raw_input()
        b = a[::-1]
        if b == a:
            n=n+1
    except EOFError:
	print n
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

n = 0
for line in stdin:
    line = line.rstrip()
    if line == line[::-1]:
        n += 1

print(n)

Submission status: Accepted

Solution code:
import sys
ans=0
for string in sys.stdin.readlines():
    string = string.strip()
    ans += 1 if string == "".join(reversed([v for v in string])) else 0
print ans

Submission status: Accepted

Solution code:
import sys

c = 0
for s in sys.stdin:
    s = s.rstrip()
    l = len(s)
    if s[:(l/2+l%2)] == s[(l/2):][::-1]:
        c += 1
print c

Submission status: Accepted

Solution code:
import sys

c = 0
for s in sys.stdin:
	s = s.strip()
	if s == s[::-1]:
		c += 1
print c

Submission status: Accepted

Solution code:
import sys
c=0
for s in sys.stdin:
    s=s[:-1]
    if s==s[::-1]:c+=1
print c

Submission status: Accepted

Solution code:
import sys
c=0
for s in sys.stdin:
    if s[:-1]==s[::-1][1:]:c+=1
print c

Submission status: Accepted

Solution code:
import sys
c=0
for s in sys.stdin:
  s=s[:-1]
  if s==s[::-1]:c+=1
print c

Submission status: Accepted

Solution code:
count = 0
while True:
    try:
        flag = 1
        a = raw_input()
        if len(a) == 1:
            count += 1
        else:
            for i in range(len(a)/2):
                if a[i] != a[len(a)-1-i]:
                    flag = 0
                    break
            if flag == 1:
                count += 1    
    except:
        break
print count

Submission status: Accepted

Solution code:
count = 0
while True:
    try:
        a = raw_input()
        count += 1
        if len(a) > 1:
            for i in range(len(a)/2):
                if a[i] != a[len(a)-1-i]:
                    count -= 1
                    break
    except:
        break
print count

Submission status: Accepted

Solution code:
count = 0
while True:
    try:
        a = raw_input()
        count += 1
        for i in range(len(a)/2):
            if a[i] != a[len(a)-1-i]:
                count -= 1
                break
    except:
        break
print count

Submission status: Accepted

Solution code:
ct = 0
try:
    while True:
        s = raw_input()
        if len(s) == 1 or s[:(len(s) + 1) / 2] == s[-1:len(s) / 2 - 1:-1]:
            ct += 1
except EOFError:
    pass
print ct

Submission status: Accepted

Solution code:
def is_palindrome(string):
    for i in xrange(len(string) / 2):
        if string[i] != string[-1 - i]:
            return False
    return True


ret = 0
while 1:
    try:
        if is_palindrome(raw_input()):
            ret += 1
    except EOFError:
        break
print ret

Submission status: Accepted

Solution code:
count = 0
while True:
    try:
        s = input()
    except EOFError:
        break

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

print(count)

Submission status: Accepted

Solution code:
ans = 0
while True:
    try:
        s = str(input())
        if s == s[::-1]:
            ans += 1
    except EOFError:
        break
print(ans)

Submission status: Accepted

Solution code:
ans=0
while True:
    try:
        s=list(str(input()))
    except EOFError:
        break
    a=[]
    for i in range(len(s),0,-1):
        a.append(s[i-1])
    if a==s:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
count=0
while 1:
    try:N=input()
    except:break
    if N==N[::-1]:count +=1
print(count)

Submission status: Accepted

Solution code:
a=0
while True:
    try:
        n=list(input())
        if n==n[::-1]:
            a+=1
    except:
        break
print(a)

Submission status: Accepted

Solution code:
ans = 0
while True:
	try:
		s = str(input())
		if s == s[::-1]:
		    ans += 1
	except:
	    break
print(ans)

Submission status: Accepted

Solution code:
c = 0;
while True:
    try:
        m = str(input());
    except EOFError:
        break;
    o = ''.join(list(reversed(m)));
    if m == o:
        c += 1;
print(c);

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
c = 0
while True:
   try:
      s = input()
      cc = 0
      for i in range(len(s)):
         if s[i] == s[len(s) - 1 - i]:
            cc += 1
      if cc == len(s):
         #print("@", s)
         c += 1
   except EOFError:
      break
   
print(c)

Submission status: Accepted

Solution code:
a=0
while True:
    try:
        b = input()
        if b == b[::-1]:
            a+=1
    except:
        break
print(a)

Submission status: Accepted

Solution code:
s=0
while True:
    try:
        i=input()
        if i==i[::-1]:
            s+=1
    except:
        break
print(s)

Submission status: Accepted

Solution code:
num = 0
while True:
    try:
        x = input()
        if x == x[::-1]:
            num += 1
    except EOFError:
        print(num)
        break

Submission status: Accepted

Solution code:
c = 0
while True:
  try:
    s = input()
  except EOFError:
     break
  if s == s[::-1]:
    c += 1
print(c)

Submission status: Accepted

Solution code:
c=0
while True:
    try:
        moji=input()
        if moji==moji[::-1]:
            c+=1
    except EOFError:
        break
print(c)

Submission status: Accepted

Solution code:
num=0
while True :
    try:
        a=input()
        b=(a[::-1]) 
        if a==b : num+=1
    except: break
print(num)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s=0
while True:
    try:
        x=input()
        X=x[::-1]
        if x==X:
            s+=1
        else:
            pass
    except EOFError:
        break
print(s)

Submission status: Accepted

Solution code:
#回文
#while文で終わりまで入力繰り返す
#沢山の入力の中で回文を見つけたらcnt+=1
#スタック機能を使い、input半分を読み込み回文を作り、それを元々と比べる
#上から読んでも下から読んでも同じ

count = 0

while 1:
    try:
        n = input()
        if n == n[::-1]: #元と逆順にしても同じ
            count += 1
    except:
        print(count)
        break

Submission status: Accepted

Solution code:
x=0
while True:
    try:
        s=list(str(input()))
        n=0
        for i in range(len(s)//2):
            if s[i]!=s[len(s)-1-i]:
                break
            n+=1
        if n==len(s)//2:
            x+=1
    except:
        break
print(x)

Submission status: Accepted

Solution code:
s=0
while True:
    try:
        n = input()
    except EOFError:
        break
    
    rn = n[::-1]
    if n ==rn :
        s+=1
print(s)

Submission status: Accepted

Solution code:
# 91
c = 0
while True:
    try:
        t = input()
    except EOFError:
        break

    if t == t[::-1]:
        c += 1

print(c)

Submission status: Accepted

Solution code:
ans = 0
while True:
    try:
        string = input()
    except:
        break
    ans += [0, 1][string == string[::-1]]
print(ans)

Submission status: Accepted

Solution code:
s=0
while 1:
    try:
        n=input()
        if n==n[::-1]:
            s+=1
    except EOFError:
        print(s)
        break

Submission status: Accepted

Solution code:
q=0
while True:
   try:
      x = input()
      c = 0
      if len(x)%2==0:
         for i in range(len(x)//2):
            if x[i] == x[len(x)-i-1]:
               c += 1
            else:
               pass
         if c == len(x)//2:
            q += 1
      else:
         for j in range((len(x)-1)//2):
            if x[j] == x[len(x)-j-1]:
               c += 1
            else:
               pass
         if c == (len(x)-1)//2:
            q += 1
   except EOFError:
      break
print(q)

Submission status: Accepted

Solution code:
s=0
while True:
    try:
        x=input()
        X=x[::-1]
        if x==X:
            s+=1
        else:
            pass
    except EOFError:
        break
print(s)

Submission status: Accepted

Solution code:
# coding: utf-8
# 91
c = 0
while True:
    try:
        m=input()
        M = m[::-1]
        #print(m,M)
        if m==M:
            c += 1
    except:
        break
    
print(c)

Submission status: Accepted

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

n = 0
while True:
    try:
        t = str(input())
        if t == t[::-1]:
            n += 1
    except EOFError:
        break
print(n)

Submission status: Accepted

Solution code:
ans=0
while True:
    try :
        n=input()
        if n==n[::-1]:
            ans+=1
    except :
        break
print(ans)

Submission status: Accepted

Solution code:

ans = 0

while 1:
    try: a = list(input())
    except: break

    tmp = list(reversed(a))
    
    if a==tmp: ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
a=0
while True:
    try:
        x=input()
        if x==x[::-1]:
            a+=1
    except EOFError: break
print(a)

Submission status: Accepted

Solution code:
A=0
try:
    while True:
        d=str(input())
        a=list(d)
        b=len(a)
        
        if b==1:
            A+=1
            
        else:
            if b%2==0:
                c=b//2
                L=d[:c]
                e= ''.join(list(reversed(d)))
                M=e[:c]
                if L==M:
                    A+=1
            
            if b%2==1:
                c=b//2
                L=d[:c+1]
                e= ''.join(list(reversed(d)))
                M=e[:c+1]
                if L==M:
                    A+=1
                
except EOFError:
    print(A)

Submission status: Accepted

Solution code:
s = 0

while True:
    try:
        d = input()
        if str(d) == str(d)[::-1]:
            s += 1
    except EOFError:
        break
    
print(s)

Submission status: Accepted

Solution code:
list=[]
c=0
try:
    while True:
        list.append(input())
except EOFError:
    pass
for i in range(len(list)):
    
    x=list[i][::-1]
    
    
    
    if x==list[i]:
        c=c+1
print(c)

Submission status: Accepted

Solution code:
n=0
while True:
    try:
        s=str(input())
        if s==s[::-1]:
            n+=1
    except:
        break
print(n)

Submission status: Accepted

Solution code:
count=0
while True:
	try:
		s=str(input())
		if s==s[::-1]:
		    count+=1
	except:
	    break
print(count)

Submission status: Accepted

Solution code:
#0063
d = 0
while True:
    c = 0
    l = []
    try:
        text = str(input())
    except:
        break
    x = list(reversed(text))
    y = ''.join(x)
    if text == y:
        c += 1
    if c > 0:
        d += 1
print(d)

Submission status: Accepted

Solution code:
c = 0
while True:
    try:
        cha = input()
        pal = cha[::-1]
        if cha == pal:
            c +=1

    except EOFError:
        break

print(c)

Submission status: Accepted

Solution code:
sum=0
while True:
    try:
        n=input()
        m=n[::-1]
        if m==n:
            sum+=1
    except:
        break
print(sum)

Submission status: Accepted

Solution code:
C=0
while True:
    try:
        a=input()
        b=len(a)//2
        c=0
        i=0
        while i<b:
            if a[i]==a[len(a)-1-i]:
                i+=1
                c+=1
            else:
                break
        if c==b:
            C+=1
    except:
        print(C)
        break

Submission status: Accepted

Solution code:
s=0
while True:
    try:
        x=input()
        X=x[::-1]
        if x==X:
            s+=1
        else:
            pass
    except EOFError:
        break
print(s)

Submission status: Accepted

Solution code:
a = []
while True:
    try:
        s = str(input())
        x = s[::-1]
        if s == x:
            a.append(s)
    except:
        break
    
print(len(a))

Submission status: Accepted

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

c = 0
while True:
   try:
      s = input()
      cc = 0
      for i in range(len(s)):
         if s[i] == s[len(s) - 1 - i]:
            cc += 1
      if cc == len(s):
         #print("@", s)
         c += 1

   except EOFError:
      break
   
print(c)

Submission status: Accepted

Solution code:
ans = 0
while True:
    try:
        a = list(input())
    except:
        break
    
    b = list(reversed(a))
    
    if a == b:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
kai=0

while True:
    try:
        k=input()
        n=int(len(k)/2)
        ch=0
        
        for i in range(n):
            if k[i]!=k[-(i+1)]:
                ch=1
                break
        
        if ch==0:
            kai+=1
    
    except:
        print(kai)
        break

Submission status: Accepted

Solution code:
c=0
while True:
    try:
        n=input()
    except:
        break
    m=n[::-1]
    if m==n:
        c+=1
print(c)

Submission status: Accepted

Solution code:
a = 0
while 1:
    try:
        n = input()
        if n == n[::-1]:
            a += 1
    except:
        break
print(a)

Submission status: Accepted

Solution code:
ans = 0
while True :
    try :
        s = list(input())
    except EOFError :
        break
    
    pal = "True"
    for i in range(len(s)//2) :
        if s[i] != s[-i-1] :
            pal = "False"
            break
    if pal == "True" :
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
count = 0
while True:
    try:
        text = list(input())
        
        a = len(text)
        b = a//2
        _te = []
        te_ = []
        
        for i in range(0,b):
            _te.append(text[i])
            te_.append(text[a-1-i])
        
        if _te==te_:
            count += 1
    
    except:
        break
print(count)

Submission status: Accepted

Solution code:
import sys
readlines = sys.stdin.readlines
write = sys.stdout.write
def solve():
    ans = 0
    for line in readlines():
        s = line.strip()
        if s == s[::-1]:
            ans += 1
    write("%d\n" % ans)
solve()

Submission status: Accepted

Solution code:
cnt = 0

while True :
    try :
        n = list(input())
        N = list(reversed(n))
        
        if n == N :
            cnt += 1
            
    except :
        print(cnt)
        break

Submission status: Accepted

Solution code:
s=0
for i in range(1,51):
    try:
        n=list(map(str,input()))
    except:
        break
    y=n[::-1]
    if n==y:
        s+=1
    else:
        pass
print(s)

Submission status: Accepted

Solution code:
ans = 0
while 1:
    try:
        s = input()
    except:break
    if(s == s[::-1]):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def search(string,c):
    for i in range(c):
        #print(i,string[i],string[len(string)-1-i])
        if ((string[i])!=(string[len(string)-1-i])):
            return False
    return True
    
SUM=0
#対称の文字列の和を出力
while True:
    try:
        string=list(map(str,input()))
    except EOFError:
        break
    c=int(len(string)/2)
    if len(string)%2==1:                        #奇数の時
        del string[c]
    if search(string,c)==True:
        SUM+=1

print(SUM)

Submission status: Accepted

Solution code:
ans = 0
while True:
    try:
        s = str(input())
        if s == s[::-1]: ans += 1
    except:
        break
print (ans)

Submission status: Accepted

Solution code:

c = 0
while True:
    try:
        s = input()
        t = s[::-1]
        print
        if s == t:
            c += 1
    except EOFError:
        break

print(c)

Submission status: Accepted

Solution code:
cnt = 0
while 1:
    try:
        s = input()
        if s == s[::-1]:
            cnt += 1
    except:
        print(cnt)
        break

Submission status: Accepted

Solution code:
import copy

if __name__ == '__main__':
    
    cnt = 0
    while True:
        try:
            line = list(input())
            tmp = line.copy()
            tmp.reverse()
            if line == tmp:
                cnt += 1

        except EOFError:
            break

    print(cnt)

Submission status: Accepted

Solution code:
count=0
while 1:
    try:
        sc=input()
        if sc==sc[::-1]:count+=1
    except:break
print(count)

Submission status: Accepted

Solution code:
count = 0
while(1):
    try:
        a = list(input())
        b = a[::-1]
        if a == b:
            count += 1
    except EOFError:
        print(count)
        break

Submission status: Accepted

Solution code:
cnt = 0

while 1:
    try:
        word = input()
    except EOFError:
        break

    if word == word[::-1]:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
cnt = 0
while True:
    try: n = input()
    except: break
    if n == n[::-1]:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
ans = 0
while True:
    try:
        string = input()
    except:
        break
    ans += [0, 1][string == string[::-1]]
print(ans)

Submission status: Runtime Error

Solution code:
c = 0
try:
	while 1:
		s = raw_input()
		if s[::-1] == s:
			c += 1

print c

Submission status: Runtime Error

Solution code:
count = 0
while 1:
    a = raw_input()
    b = a[::-1]
    if a == b: count+=1
    print count