import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
String A=in.nextLine();
String B=in.nextLine();
int count=0;//统计正确的插入方法
for(int i=0;i<=A.length();i++){ //插入0...length下标
StringBuffer str=new StringBuffer(A);
str.insert(i,B);//插入到i下标
StringBuffer tmp=new StringBuffer(str);//作为交换的媒介
tmp.reverse();//翻转,判断
if(str.toString().equals(tmp.toString())){//相等,则为正确的插入方法
count++;
}
}
System.out.println(count);
}
}


