def 统计回文(a,b): n = 0 for i in range(len(a)+1): c = a.copy() for j in range(len(b)): c.insert(i+j,b[j]) m = 0 if int(len(c) % 2) == 0: for i in range(int(len(c)/2)): if c[i] == c[-(i+1)]: m += 1 #print(1,m,len(c)/2) if m == int(len(c)/2): n += 1 else: for i in range(int((len(c)-1)/2)): if c[i] == c[-(i+1)]: m += 1 #print(2,m,(len(c)-1)/2) if m == int((len(c)-1)/2): n += 1 return n print(统计回文(list(i for i in input()),list(i for i in input())))