import sys
def z_function(string, z, lenth):
left = 0
right = 0
for i in xrange(1, lenth):
if i <= right:
z[i] = min(z[i - left], right - i + 1)
while i + z[i] < lenth and string[z[i]] == string[i + z[i]]:
z[i] += 1
if i + z[i] - 1 > right:
right = i + z[i] - 1
left = i
def main():
flag = 0
for line in sys.stdin:
if flag == 0:
n = int(line.strip())
flag = 1
continue
elif flag == 1:
needle = line.strip()
flag = 2
continue
else:
haystack = line.strip()
flag = 0
string = needle + '&' + haystack
lenth = len(string)
z = [0] * lenth
z_function(string, z, lenth)
s = 0
for i in xrange(n + 1, lenth - n + 1):
if z[i] == n:
s = 1
print i - n - 1
if s == 1:
sys.stdout.write("\n\n")
if __name__ == "__main__":
main()
aW1wb3J0IHN5cwoKCmRlZiB6X2Z1bmN0aW9uKHN0cmluZywgeiwgbGVudGgpOgoKICAgIGxlZnQgPSAwCiAgICByaWdodCA9IDAKCiAgICBmb3IgaSBpbiB4cmFuZ2UoMSwgbGVudGgpOgogICAgICAgIGlmIGkgPD0gcmlnaHQ6CiAgICAgICAgICAgICB6W2ldID0gbWluKHpbaSAtIGxlZnRdLCByaWdodCAtIGkgKyAxKQogICAgICAgIHdoaWxlIGkgKyB6W2ldIDwgbGVudGggYW5kIHN0cmluZ1t6W2ldXSA9PSBzdHJpbmdbaSArIHpbaV1dOgogICAgICAgICAgICB6W2ldICs9IDEKICAgICAgICBpZiBpICsgeltpXSAtIDEgPiByaWdodDoKICAgICAgICAgICAgcmlnaHQgPSBpICsgeltpXSAtIDEKICAgICAgICAgICAgbGVmdCA9IGkKCgpkZWYgbWFpbigpOgogICAgZmxhZyA9IDAKCiAgICBmb3IgbGluZSBpbiBzeXMuc3RkaW46CiAgICAgICAgaWYgZmxhZyA9PSAwOgogICAgICAgICAgICBuID0gaW50KGxpbmUuc3RyaXAoKSkKICAgICAgICAgICAgZmxhZyA9IDEKICAgICAgICAgICAgY29udGludWUKICAgICAgICBlbGlmIGZsYWcgPT0gMToKICAgICAgICAgICAgbmVlZGxlID0gbGluZS5zdHJpcCgpCiAgICAgICAgICAgIGZsYWcgPSAyCiAgICAgICAgICAgIGNvbnRpbnVlCiAgICAgICAgZWxzZToKICAgICAgICAgICAgaGF5c3RhY2sgPSBsaW5lLnN0cmlwKCkKICAgICAgICAgICAgZmxhZyA9IDAKCiAgICAgICAgc3RyaW5nID0gbmVlZGxlICsgJyYnICsgaGF5c3RhY2sKCiAgICAgICAgbGVudGggPSBsZW4oc3RyaW5nKQogICAgICAgIHogPSBbMF0gKiBsZW50aAogICAgICAgIHpfZnVuY3Rpb24oc3RyaW5nLCB6LCBsZW50aCkKICAgICAgICBzID0gMAogICAgICAgIGZvciBpIGluIHhyYW5nZShuICsgMSwgbGVudGggLSBuICsgMSk6CiAgICAgICAgICAgIGlmIHpbaV0gPT0gbjoKICAgICAgICAgICAgICAgIHMgPSAxCiAgICAgICAgICAgICAgICBwcmludCBpIC0gbiAtIDEKICAgICAgICBpZiBzID09IDE6CiAgICAgICAgICAgIHN5cy5zdGRvdXQud3JpdGUoIlxuXG4iKQoKaWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoKICAgIG1haW4oKQ==