import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException;
public class Main{ public static void main(String[] args)throws IOException{ BufferedReader bf=new BufferedReader(new InputStreamReader(System.in)); String a=bf.readLine(); String b=bf.readLine(); int len_a=a.length(); int len_b=b.length(); int ret=0; for(int i=0;i<=len_a;i++){ int fri_index=0,las_index=len_a+len_b-1; int real_fri,real_las; int fri_num; int las_num; boolean isIt=true; while(fri_index<las_index){ if(fri_index<i){ real_fri=fri_index; fri_num=a.charAt(real_fri); }else if(fri_index<=i+len_b-1){ real_fri=fri_index-i; fri_num=b.charAt(real_fri); }else{ real_fri=fri_index-len_b; fri_num=a.charAt(real_fri); } if(las_index>=i+len_b){ real_las=las_index-len_b; las_num=a.charAt(real_las); }else if(las_index>=i){ real_las=las_index-i; las_num=b.charAt(real_las); }else{ real_las=las_index; las_num=a.charAt(real_las); } if(fri_num!=las_num){ isIt=false; break; } fri_index++; las_index--; } if(isIt==true){ ret++; } } System.out.println(ret); } }