import sys
import copy

data=sys.stdin.readlines()
key=data[1].strip("\n")
l=list(data[0])
l.remove("\n")


def ishuiwen(l):
    i=0
    j=len(l)-1
    while i < len(l):
        if i>=j:
            return True
        if j>i and l[i]!=l[j]:
            return False
        i=i+1
        j=j-1

count=0

for i in range(len(l)+1):
    sax=copy.deepcopy(l)
    sax.insert(i,key)
    p="".join(sax)
    p=list(p)
    if ishuiwen(p):
        count=count+1

print(count)