local s = io.read() local n = #s local m = io.read("*n", "*l") local cnt = 0 for i = 1, m do local t = io.read() local p = 1 while p do p = s:find(t, p) if p then cnt = cnt + 1 p = p + 1 end end end print(cnt)