import sys

c=0

for s in sys.stdin:

    s=s[:-1]

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

print(c)
import sys

c=0

for s in sys.stdin:

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

print(c)
import sys

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

import sys

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

-    s = s[:-1] -    if s == s[::-1]: +    if s[:-1] == s[::-1][1:]: