{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv\u003e\u003cp\u003eA substring of a string \u003ci\u003eT\u003c/i\u003e is defined as:\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003ccenter\u003e\u003ci\u003eT\u003c/i\u003e(\u003ci\u003ei\u003c/i\u003e, \u003ci\u003ek\u003c/i\u003e)\u003d\u003ci\u003eT\u003csub\u003ei\u003c/sub\u003eT\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e\u003csub\u003e+1\u003c/sub\u003e...\u003ci\u003eT\u003csub\u003ei+k\u003c/sub\u003e\u003c/i\u003e\u003csub\u003e-1\u003c/sub\u003e, 1≤\u003ci\u003ei\u003c/i\u003e≤\u003ci\u003ei+k\u003c/i\u003e-1≤|\u003ci\u003eT\u003c/i\u003e|.\u003c/center\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003eGiven two strings \u003ci\u003eA\u003c/i\u003e, \u003ci\u003eB\u003c/i\u003e and one integer \u003ci\u003eK\u003c/i\u003e, we define \u003ci\u003eS\u003c/i\u003e, a set of triples (\u003ci\u003ei\u003c/i\u003e, \u003ci\u003ej\u003c/i\u003e, \u003ci\u003ek\u003c/i\u003e):\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003ccenter\u003e\u003ci\u003eS\u003c/i\u003e \u003d {(\u003ci\u003ei\u003c/i\u003e, \u003ci\u003ej\u003c/i\u003e, \u003ci\u003ek\u003c/i\u003e) | \u003ci\u003ek\u003c/i\u003e≥\u003ci\u003eK\u003c/i\u003e, \u003ci\u003eA\u003c/i\u003e(\u003ci\u003ei\u003c/i\u003e, \u003ci\u003ek\u003c/i\u003e)\u003d\u003ci\u003eB\u003c/i\u003e(\u003ci\u003ej\u003c/i\u003e, \u003ci\u003ek\u003c/i\u003e)}.\u003c/center\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003eYou are to give the value of |\u003ci\u003eS\u003c/i\u003e| for specific \u003ci\u003eA\u003c/i\u003e, \u003ci\u003eB\u003c/i\u003e and \u003ci\u003eK\u003c/i\u003e.\u003c/p\u003e\u003c/div\u003e\n给定一个数K\n\u003cbr/\u003e\n在给定两个字符串A,B\n\u003cbr/\u003e\n求三元组(i,j,k)(k\u003e\u003dK)(表示从A的第i位起和从B的j位起长度为k的字符串相同)的个数"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv\u003e\u003cp\u003eThe input file contains several blocks of data. For each block, the first line contains one integer \u003ci\u003eK\u003c/i\u003e, followed by two lines containing strings \u003ci\u003eA\u003c/i\u003e and \u003ci\u003eB\u003c/i\u003e, respectively. The input file is ended by \u003ci\u003eK\u003c/i\u003e\u003d0.\u003c/p\u003e\u003cp\u003e1 ≤ |\u003ci\u003eA\u003c/i\u003e|, |\u003ci\u003eB\u003c/i\u003e| ≤ 10\u003csup\u003e5\u003c/sup\u003e\u003cbr\u003e1 ≤ \u003ci\u003eK\u003c/i\u003e ≤ \u003ci\u003emin\u003c/i\u003e{|\u003ci\u003eA\u003c/i\u003e|, |\u003ci\u003eB\u003c/i\u003e|}\u003cbr\u003eCharacters of \u003ci\u003eA\u003c/i\u003e and \u003ci\u003eB\u003c/i\u003e are all Latin letters.\u003c/p\u003e\u003cp\u003e\u003c/p\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each case, output an integer |\u003ci\u003eS\u003c/i\u003e|.\u003c/p\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\naababaa\nabaabaa\n1\nxx\nxx\n0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e22\n5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}