Vasya string b s consist lowercase english letter the length string b equal n length string s equal m Vasya decide choose substre string choose substre string b concatenate Formally choose segment l_1 r_1 1 leq l_1 leq r_1 leq n segment l_2 r_2 1 leq l_2 leq r_2 leq n concatenation obtain stre al_1 r_1 bl_2 r_2 a_l_1 a_l_1 1 ldot a_r_1 b_l_2 b_l_2 1 ldot b_r_2Now Vasya interested counting number way choose segment adhere follow condition segment l_1 r_1 l_2 r_2 nonempty intersection ie exist integer x l_1 leq x leq r_1 l_2 leq x leq r_2 string al_1 r_1 bl_2 r_2 equal string s