s = input()
t = input()
ans = 0
n = len(s)
m = len(t)
for i in range(-m+1, n):
cnt = 0
for j in range(m):
if i + j < 0 or i + j >= n:
cnt = 0
continue
if s[i+j] == t[j]:
cnt += 1
else:
cnt = 0
ans += cnt
print(ans)