Vus the Cossack has two binary strings, that is, strings that consist only of "0" and "1". We call these strings $a$ and $b$. It is known that $|b| \leq |a|$, that is, the length of $b$ is at most the length of $a$.

The Cossack considers every substring of length $|b|$ in string $a$. Let's call this substring $c$. He matches the corresponding characters in $b$ and $c$, after which he counts the number of positions where the two strings are different. We call this function $f(b, c)$.

For example, let $b = 00110$, and $c = 11000$. In these strings, the first, second, third and fourth positions are different.

Vus the Cossack counts the number of such substrings $c$ such that $f(b, c)$ is even.

For example, let $a = 01100010$ and $b = 00110$. $a$ has four substrings of the length $|b|$: $01100$, $11000$, $10001$, $00010$.  $f(00110, 01100) = 2$; $f(00110, 11000) = 4$; $f(00110, 10001) = 4$; $f(00110, 00010) = 1$. 

Since in three substrings, $f(b, c)$ is even, the answer is $3$.

Vus can not find the answer for big strings. That is why he is asking you to help him.


-----Input-----

The first line contains a binary string $a$ ($1 \leq |a| \leq 10^6$) — the first string.

The second line contains a binary string $b$ ($1 \leq |b| \leq |a|$) — the second string.


-----Output-----

Print one number — the answer.


-----Examples-----
Input
01100010
00110

Output
3

Input
1010111110
0110

Output
4



-----Note-----

The first example is explained in the legend.

In the second example, there are five substrings that satisfy us: $1010$, $0101$, $1111$, $1111$.

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Mathematics

Implementation


Solutions:
(n, m) = (input(), input())
ln = len(n)
lm = len(m)
ans = cnt = 0
for i in range(lm):
	if n[i] == '1':
		cnt += 1
	if m[i] == '1':
		cnt += 1
if cnt % 2 == 0:
	ans = 1
for i in range(lm, ln):
	if n[i] == '1':
		cnt += 1
	if n[i - lm] == '1':
		cnt -= 1
	if cnt % 2 == 0:
		ans += 1
print(ans)


from collections import deque
a = input()
b = input()
a1 = len(a)
b1 = len(b)
k = 0
d = deque([])
for i in range(b1):
	if a[i] != b[i]:
		k += 1
l = 0
if k % 2 == 0:
	l += 1
if a1 == b1:
	print(l)
else:
	for i in range(b1):
		if a[i] == a[i + 1]:
			d.append(0)
		else:
			d.append(1)
	m = sum(d)
	k += m
	if k % 2 == 0:
		l += 1
	for i in range(1, a1 - b1):
		m -= d[0]
		d.popleft()
		if a[i + b1] == a[i + b1 - 1]:
			d.append(0)
		else:
			d.append(1)
		m += d[-1]
		k += m
		if k % 2 == 0:
			l += 1
	print(l)


import sys
sys.setrecursionlimit(1000000)

class Main:

	def __init__(self):
		self.buff = None
		self.index = 0

	def __next__(self):
		if self.buff is None or self.index == len(self.buff):
			self.buff = self.next_line()
			self.index = 0
		val = self.buff[self.index]
		self.index += 1
		return val

	def next_line(self):
		return sys.stdin.readline().split()

	def next_ints(self):
		return [int(x) for x in sys.stdin.readline().split()]

	def next_int(self):
		return int(next(self))

	def solve(self):
		a = next(self)
		b = next(self)
		d = 0
		g = 0
		for i in range(len(b)):
			if a[i] != b[i]:
				d += 1
			if i > 0 and b[i] != b[i - 1]:
				g += 1
		ans = 1 if d % 2 == 0 else 0
		for i in range(len(b), len(a)):
			if a[i] != b[-1]:
				d += 1
			if a[i - len(b)] != b[0]:
				d += 1
			d += g
			if d % 2 == 0:
				ans += 1
		print(ans)

def __starting_point():
	Main().solve()
__starting_point()


a = input()
b = input()
Ans = 0
X = 0
Y = 0
for i in range(len(b)):
	if a[i] == '1':
		X += 1
	if b[i] == '1':
		Y += 1
if X % 2 == Y % 2:
	Ans += 1
for i in range(len(b), len(a)):
	if a[i] == '1':
		X += 1
	if a[i - len(b)] == '1':
		X += 1
	if X % 2 == Y % 2:
		Ans += 1
print(Ans)


A = input()
B = input()
cnt1b = 0
for i in B:
	if i == '1':
		cnt1b += 1
a = []
for i in range(len(A)):
	if i == 0:
		if A[i] == '1':
			a.append(1)
		else:
			a.append(0)
	else:
		a.append(a[i - 1] + (1 if A[i] == '1' else 0))
ans = 0
for i in range(len(a)):
	if i + len(B) - 1 >= len(a):
		break
	cnt = 0
	if i > 0:
		cnt -= a[i - 1]
	cnt += a[i + len(B) - 1]
	ans += cnt % 2 == cnt1b % 2
print(ans)


import sys
from math import floor, ceil
IS_LOCAL = False

def read_one(dtype=int):
	return dtype(input())

def read_multiple(f, dtype=int):
	return f(map(dtype, input().split()))

def main():
	a = '01100010'
	b = '00110'
	if not IS_LOCAL:
		a = input()
		b = input()

	def cst(x):
		return 0 if x == '0' else 1

	def rsum(arr):
		return sum(map(cst, arr))
	(sb, lb) = (rsum(b), len(b))
	s = None
	res = 0
	for i in range(lb - 1, len(a)):
		if s is None:
			s = rsum(a[:lb])
		else:
			s = s - cst(a[i - lb]) + cst(a[i])
		if (s - sb) % 2 == 0:
			res += 1
	print(res)
if len(sys.argv) > 1 and sys.argv[1] == 'True':
	IS_LOCAL = True
main()


a = input()
b = input()
(k, ans) = (1, 0)
for i in range(len(b)):
	k ^= a[i] != b[i]
ans = k
for i in range(len(b), len(a)):
	k ^= a[i] != a[i - len(b)]
	ans += k
print(ans)


a = input()
b = input()
lea = len(a)
leb = len(b)
c1 = 0
c2 = 0
for i in range(leb):
	if a[i] == '1':
		c1 += 1
	if b[i] == '1':
		c2 += 1
ans = 0
if c1 % 2 == c2 % 2:
	ans += 1
for j in range(leb, lea):
	if a[j] == '1':
		c1 += 1
	if a[j - leb] == '1':
		c1 -= 1
	if c1 % 2 == c2 % 2:
		ans += 1
print(ans)


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
(src, tgt) = ([int(x) for x in input()], [int(x) for x in input()])
(lens, lent) = (len(src), len(tgt))
answ = 0
nmc = sum([1 for (x, y) in zip(src[:lent], tgt) if x != y])
answ += nmc % 2 == 0
for i in range(lent, lens):
	nmc += src[i] != src[i - lent]
	answ += nmc % 2 == 0
print(answ)


def value_dif(a_string, b_string, size_a, size_b):
	count = [0, 0]
	check = 0
	for i in range(size_b):
		check ^= int(a_string[i]) ^ int(b_string[i])
	count[check] = 1
	for i in range(0, size_a - size_b):
		check ^= int(a_string[i]) ^ int(a_string[i + size_b])
		count[check] += 1
	return count[0]

def main():
	a = input()
	b = input()
	a_len = len(a)
	b_len = len(b)
	even = value_dif(a, b, a_len, b_len)
	print(even)
main()


def is_good(a, b):
	if (int(a, 2) & b) % 2 == 0:
		return 1
	return 0

def go():
	a = input()
	b = input()
	c_b = sum((1 for i in b if i == '1'))
	c_a = sum((1 for i in range(len(b)) if a[i] == '1'))
	c = 0
	if c_b % 2 == c_a % 2:
		c += 1
	for i in range(len(b), len(a)):
		c_b -= int(a[i - len(b)])
		c_b += int(a[i])
		if c_b % 2 == c_a % 2:
			c += 1
	return c
print(go())


a = input()
b = input()
(cnt1, cnt2) = (0, 0)
for i in range(len(b)):
	cnt1 += a[i] == '1'
for i in b:
	cnt2 += i == '1'
ans = cnt1 % 2 == cnt2 % 2
for i in range(len(b), len(a)):
	cnt1 += a[i] == '1'
	cnt1 -= a[i - len(b)] == '1'
	ans += cnt1 % 2 == cnt2 % 2
print(ans + 0)


import collections as cc
import math as mt
import sys
I = lambda : list(map(int, input().split()))
a = input()
b = input()
no = 0
for i in range(len(b)):
	if a[i] != b[i]:
		no += 1
ans = 0
if no % 2 == 0:
	ans += 1
for i in range(len(b), len(a)):
	if a[i] != a[i - len(b)]:
		no += 1
	if no % 2 == 0:
		ans += 1
print(ans)


a = input()
b = input()
aCount = 0
for i in range(0, len(b)):
	aCount += 1 if a[i] == '1' else 0
bCount = 0
for i in range(len(b)):
	bCount += 1 if b[i] == '1' else 0
res = 0
for i in range(0, len(a) - len(b)):
	if aCount % 2 == bCount % 2:
		res += 1
	aCount += 1 if a[len(b) + i] == '1' else 0
	aCount -= 1 if a[i] == '1' else 0
if aCount % 2 == bCount % 2:
	res += 1
print(res)


A = input()
B = input()
a = len(A)
b = len(B)
X = A[:b]
t = 0
c = 0
for i in range(b):
	if B[i] != X[i]:
		t += 1
if t % 2 == 0:
	c += 1
for i in range(b, a):
	if A[i] == A[i - b]:
		if t % 2 == 0:
			c += 1
	else:
		t += 1
		if t % 2 == 0:
			c += 1
print(c)


def changelling(s, t):
	(count1, count2, count) = (0, 0, 0)
	(n, m) = (len(s), len(t))
	for i in range(m):
		if t[i] == '1':
			count2 = (count2 + 1) % 2
	for i in range(m):
		if s[i] == '1':
			count1 = (count1 + 1) % 2
	for i in range(m - 1, n):
		if count1 == count2:
			count += 1
		if i == n - 1:
			continue
		if s[i - m + 1] == '1':
			count1 = (count1 + 1) % 2
		if s[i + 1] == '1':
			count1 = (count1 + 1) % 2
	return count
x = input()
y = input()
print(changelling(x, y))


import sys
from collections import deque
a = input().rstrip()
b = input().rstrip()
la = len(a)
lb = len(b)
pre = [0] * (la + 1)
for i in range(la):
	if a[i] == '1':
		pre[i + 1] += 1
for i in range(1, la + 1):
	pre[i] += pre[i - 1]
cntB = 0
for i in range(lb):
	if b[i] == '1':
		cntB += 1
cntB %= 2
ans = 0
for i in range(la - lb + 1):
	if (pre[i + lb] - pre[i]) % 2 == cntB:
		ans += 1
print(ans)


def sum_digits(num):
	num = str(num)
	sum = 0
	for i in num:
		sum += int(i)
	return sum

def fun(a, b):
	if a % 2 == b:
		return 1
	else:
		return 0
a = input()
b = input()
b_sum = sum_digits(b) % 2
initial_sum = sum_digits(a[:len(b)])
count = 0
for i in range(len(a) - len(b) + 1):
	count += fun(initial_sum, b_sum)
	if i != len(a) - len(b):
		initial_sum = initial_sum - int(a[i]) + int(a[i + len(b)])
print(count)


arr1 = list(map(int, input()))
arr2 = list(map(int, input()))
bone = arr2.count(1) % 2
b = len(arr2)
l = list()
org = 0
for i in range(len(arr1)):
	if arr1[i] == 1:
		org = org + 1
	if i >= b and arr1[i - b] == 1:
		org = org - 1
	l.append(org % 2)
score = 0
for i in range(b - 1, len(arr1)):
	if l[i] == bone:
		score += 1
print(score)


a = input()
b = input()
x = b.count('1') % 2
pref = [0] * (len(a) + 1)
for i in range(len(a)):
	if a[i] == '0':
		pref[i] = pref[i - 1]
	else:
		pref[i] = pref[i - 1] + 1
ans = 0
for i in range(len(a) - len(b) + 1):
	if (pref[i + len(b) - 1] - pref[i - 1]) % 2 == x:
		ans += 1
print(ans)


a = input()
b = input()
n = len(a)
m = len(b)
ans = 0
cb = 0
for x in b:
	if x == '1':
		cb = cb + 1
sm = []
sm.append(0)
for i in range(n):
	if a[i] == '1':
		sm.append(sm[i] + 1)
	else:
		sm.append(sm[i])
for i in range(m, n + 1):
	how = sm[i] - sm[i - m]
	if how % 2 == cb % 2:
		ans = ans + 1
print(ans)


from sys import stdin, stdout

def input():
	return stdin.readline().rstrip('\n')

def print(x, end='\n'):
	return stdout.write(str(x) + str(end))

def f(a, b):
	ans = 0
	for i in range(len(b)):
		if a[i] != b[i]:
			ans += 1
	return ans
a = input()
b = input()
lastCount = 0
ans = 0
for i in range(len(a) - len(b) + 1):
	if i == 0:
		lastCount = f(a[i:], b)
		ans += 1 if lastCount % 2 == 0 else 0
	else:
		if a[i - 1] != a[len(b) + i - 1]:
			lastCount += 1
		ans += 1 if lastCount % 2 == 0 else 0
print(ans)


from sys import stdin
input = stdin.readline

def cosssack(a, b):
	la = len(a)
	lb = len(b)
	ans = 0
	tot = 0
	for i in range(lb):
		if a[i] != b[i]:
			tot += 1
	ans += tot % 2 == 0
	for i in range(lb, la):
		if a[i] != a[i - lb]:
			tot += 1
		ans += tot % 2 == 0
	return ans
a = input().strip()
b = input().strip()
print(cosssack(a, b))


a = input()
b = input()
la = len(a)
lb = len(b)
bbits = b.count('1')
abits = a[0:lb].count('1')
even = (abits + bbits) % 2 == 0
result = 1 if even else 0
for (s, e) in zip(a, a[lb:]):
	if s != e:
		even = not even
	if even:
		result += 1
print(result)


import sys
a = list(map(int, sys.stdin.readline().rstrip()))
b = list(map(int, sys.stdin.readline().rstrip()))
for i in range(1, len(a)):
	a[i] += a[i - 1]
b_sum = sum(b)
ans = 0
ans += a[len(b) - 1] % 2 == b_sum % 2
for i in range(len(b), len(a)):
	ans += (a[i] - a[i - len(b)]) % 2 == b_sum % 2
print(ans)


a = input()
b = input()
f = 0
delta = 0
for i in range(len(b)):
	f += a[i] != b[i]
	if i < len(a) - 1 and a[i] != a[i + 1]:
		delta += 1
ans = 0
f %= 2
ans = f % 2 == 0
for i in range(len(b), len(a)):
	f += delta % 2
	f %= 2
	ans += f % 2 == 0
	delta -= a[i - len(b)] != a[i - len(b) + 1]
	if i < len(a) - 1:
		delta += a[i + 1] != a[i]
print(int(ans))


a = list(map(int, list(input())))
b = list(map(int, list(input())))
bs = sum(b) % 2
for i in range(1, len(a)):
	a[i] += a[i - 1]
ans = 0
a.append(0)
for i in range(len(b) - 1, len(a) - 1):
	if (a[i] - a[i - len(b)]) % 2 == bs:
		ans += 1
print(ans)


import sys, math

def read_int():
	return int(sys.stdin.readline().strip())

def read_int_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def read_string():
	return sys.stdin.readline().strip()

def read_string_list(delim=' '):
	return sys.stdin.readline().strip().split(delim)

def print_list(l):
	print(' '.join(map(str, l)))
a = read_string()
b = read_string()
b_1 = sum([1 for i in b if i == '1'])
init_a_1 = sum([1 for i in a[:len(b)] if i == '1'])
count = 0
count += b_1 % 2 == init_a_1 % 2
for i in range(len(b), len(a)):
	init_a_1 -= int(a[i - len(b)])
	init_a_1 += int(a[i])
	count += b_1 % 2 == init_a_1 % 2
print(count)


import sys
import math
from collections import defaultdict, deque
input = sys.stdin.readline

def inar():
	return [int(el) for el in input().split()]

def main():
	t = 1
	for _ in range(t):
		a = input().strip()
		b = input().strip()
		ans = 0
		count = 0
		check = 0
		for i in range(len(b)):
			if a[i] == '1':
				count += 1
			if b[i] == '1':
				check += 1
		i = 0
		j = len(b) - 1
		while j < len(a):
			if count % 2 == check % 2:
				ans += 1
			if a[i] == '1':
				count -= 1
			i += 1
			j += 1
			if j >= len(a):
				break
			if a[j] == '1':
				count += 1
		print(ans)
main()


import collections
import time
import os
import sys
import bisect
import heapq
from typing import List

def solve(A, B):
	ones = sum([int(x) for x in list(B)])
	A = [int(x) for x in list(A)]
	oa = sum([int(x) for x in A[:len(B)]])
	ans = 1 if ones % 2 == oa % 2 else 0
	for i in range(len(B), len(A)):
		oa += A[i]
		oa -= A[i - len(B)]
		ans += 1 if ones % 2 == oa % 2 else 0
	return ans
A = input()
B = input()
print(solve(A, B))


a = input()
b = input()
la = len(a)
lb = len(b)
parity = 0
for i in range(lb):
	if b[i] == '1':
		parity += 1
parity = parity % 2
sumarr = [0 for i in range(la)]
sumarr[0] = int(a[0])
for i in range(1, la):
	sumarr[i] = sumarr[i - 1] + int(a[i])
ans = 0
for i in range(lb - 1, la):
	if (sumarr[i] - sumarr[i - lb + 1] + int(a[i - lb + 1])) % 2 == parity:
		ans += 1
print(ans)


a = input()
b = input()
A = []
al = len(a)
bl = len(b)
A.append(0)
count = 0
for x in a:
	if x == '1':
		count += 1
	A.append(count)
evencount = 0
bcount = 0
for x in b:
	if x == '1':
		bcount += 1
for i in range(al + 1 - bl):
	acount = A[i + bl] - A[i]
	if acount % 2 == bcount % 2:
		evencount += 1
print(evencount)


a = list(input())
b = list(input())
ans1 = 0
ok = True
n1 = len(a)
n2 = len(b)
prefixSum2 = []
c = 0
while c < n2:
	prefixSum2.append(0)
	c += 1
prefixSum2[0] = int(b[0])
for i in range(1, n2):
	prefixSum2[i] = int(b[i]) + prefixSum2[i - 1]
var = prefixSum2[n2 - 1]
prefixSum1 = []
c = 0
while c < n1:
	prefixSum1.append(0)
	c += 1
prefixSum1[0] = int(a[0])
for i in range(1, n1):
	prefixSum1[i] = int(a[i]) + prefixSum1[i - 1]
q = 0
w = n2 - 1
for i in reversed(range(n2, n1, 1)):
	prefixSum1[i] = prefixSum1[i] - prefixSum1[i - n2]
while w <= n1 - 1:
	if (prefixSum1[w] + var) % 2 == 0:
		ans1 += 1
	w += 1
print(ans1)


(a, b, res) = (input(), input(), 0)
sm1 = sum(map(int, b[0:len(b)]))
sm2 = sum(map(int, a[0:len(b)]))
res += (sm1 - sm2) % 2 == 0
for i in range(len(b), len(a)):
	sm2 += a[i] == '1'
	sm2 -= a[i - len(b)] == '1'
	res += (sm1 - sm2) % 2 == 0
print(res)


a = input()
b = input()
alen = len(a)
blen = len(b)
diff = list()
ans = 0
temp = 0
for i in range(blen):
	if a[i] != b[i]:
		temp += 1
diff.append(temp % 2)
for i in range(blen, alen):
	if a[i] == a[i - blen]:
		diff.append(diff[i - blen])
	else:
		diff.append((diff[i - blen] + 1) % 2)
for d in diff:
	if d % 2 == 0:
		ans += 1
print(ans)


from sys import stdin

def solve():
	a = stdin.readline().strip()
	b = stdin.readline().strip()
	n = len(a)
	m = len(b)
	a_cnt = a[:m].count('1')
	b_cnt = b.count('1')
	ans = 0
	if (a_cnt + b_cnt) % 2 == 0:
		ans = 1
	for i in range(1, n - m + 1):
		if a[i - 1] == '1':
			a_cnt -= 1
		if a[i + m - 1] == '1':
			a_cnt += 1
		if (a_cnt + b_cnt) % 2 == 0:
			ans += 1
	print(ans)
solve()


s = input()
t = input()
ans = 0
ct = 0
for i in range(len(t)):
	if s[i] != t[i]:
		ct += 1
if ct % 2 == 0:
	ans += 1
curr = ct % 2
for i in range(len(s) - len(t)):
	if s[i] == '1':
		curr = 1 - curr
	if s[i + len(t)] == '1':
		curr = 1 - curr
	if curr == 0:
		ans += 1
print(ans)


a = input()
b = input()
x = 0
s = 0
for i in range(len(b)):
	if a[i] != b[i]:
		x += 1
if x % 2 == 0:
	s += 1
for i in range(len(b), len(a)):
	if a[i] != a[i - len(b)]:
		x += 1
	if x % 2 == 0:
		s += 1
print(s)


import sys
input = sys.stdin.readline
a = input().strip()
b = input().strip()
C1 = b.count('1')
L = len(b)
C0 = (L - a[:L].count('0') + C1) % 2
ANS = 0
if C0 % 2 == 0:
	ANS += 1
for i in range(L, len(a)):
	if a[i] == '0':
		C0 += 1
	if a[i - L] == '0':
		C0 -= 1
	if C0 % 2 == 0:
		ANS += 1
print(ANS)


from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from heapq import heappush, heappop
import math
import io
import os
import math
import bisect

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def digits(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def ceil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def mapin():
	return map(int, input().split())
a = list(input())
b = list(input())
n = len(a)
m = len(b)
ans = 0
pa = 0
ans2 = 0
for jj in range(m - 1):
	i = m - jj - 1
	if b[i - 1] != b[i]:
		ans2 ^= 1
for i in range(m):
	if a[i] != b[i]:
		pa = pa ^ 1
if pa == 0:
	ans += 1
for i in range(n - m):
	if a[i] != b[0]:
		pa ^= 1
	if a[i + m] != b[-1]:
		pa ^= 1
	pa ^= ans2
	if pa == 0:
		ans += 1
print(ans)


a = input()
b = input()
arr = []
pre = a[0]
for el in a[1:]:
	if el == pre:
		arr.append(0)
	else:
		arr.append(1)
	pre = el
s = 0
for i in range(len(b)):
	if b[i] != a[i]:
		s += 1
k = 0
if s % 2 == 0:
	k += 1
s = s % 2
t = sum(arr[0:len(b)]) % 2
for i in range(0, len(a) - len(b)):
	s += t % 2
	if s % 2 == 0:
		k += 1
	if i + 1 != len(a) - len(b):
		t = t - arr[i] + arr[i + len(b)]
print(k)


a = input()
b = input()

def count_even(a, b):
	a_count = b_count = 0
	length = len(b)
	for i in range(length):
		if b[i] == '1':
			b_count += 1
	for i in range(length):
		if a[i] == '1':
			a_count += 1
	count = 0
	if a_count % 2 == b_count % 2:
		count += 1
	for i in range(len(a) - length):
		if a[i] == '1' and a[i + length] == '0':
			a_count -= 1
		if a[i] == '0' and a[i + length] == '1':
			a_count += 1
		if a_count % 2 == b_count % 2:
			count += 1
	return count
print(count_even(a, b))


import sys

class CVusTheCossackAndStrings:

	def solve(self):
		a = input().strip()
		b = input().strip()
		n = len(a)
		m = len(b)
		oa = 0
		ob = b.count('1')
		ans = 0
		for i in range(n):
			if a[i] == '1':
				oa += 1
			if i == m - 1:
				if abs(oa - ob) % 2 == 0:
					ans += 1
			elif i >= m:
				if a[i - m] == '1':
					oa -= 1
				if abs(oa - ob) % 2 == 0:
					ans += 1
		print(ans)
solver = CVusTheCossackAndStrings()
input = sys.stdin.readline
solver.solve()


S = input()
a = input()
s = 1
for i in range(len(a)):
	if a[i] != S[i]:
		s ^= 1
ans = s
for i in range(len(S) - len(a)):
	if S[i + len(a)] != S[i]:
		s ^= 1
	ans += s
print(ans)


def counter(numb, numa):
	global count
	c1 = numb % 2 == 0 and numa % 2 == 0
	c2 = numb % 2 != 0 and numa % 2 != 0
	if c1 or c2:
		count += 1
	return count
a = str(input())
b = str(input())

def count_ones(D):
	setBitsb = [ones for ones in D if ones == '1']
	num1 = len(setBitsb)
	return num1
numb = count_ones(b)
lb = len(b)
count = 0
count1 = count_ones(a[:lb])
counter(numb, count1)
for i in range(len(a) - lb):
	if a[lb + i] == '1' and a[i] != '1':
		count1 += 1
		counter(numb, count1)
	elif a[lb + i] != '1' and a[i] == '1':
		count1 -= 1
		counter(numb, count1)
	else:
		counter(numb, count1)
print(count)


a = str(input())
b = str(input())
iteration = len(a) - len(b) + 1
sum_b = 0
for i in range(len(b)):
	if b[i] == '1':
		sum_b += 1
len_b = len(b)
output = 0
sum_c = 0
for j in range(len(b)):
	if a[j] == '1':
		sum_c += 1
for i in range(iteration):
	if i != 0:
		sum_c = sum_c - int(a[i - 1]) + int(a[len_b + i - 1])
	if (sum_c + sum_b) % 2 != 0:
		continue
	else:
		output += 1
print(output)


def naiveSolve(a, b, n, m):
	ans = 0
	for l in range(n):
		r = l + m - 1
		if r == n:
			break
		cnt = 0
		for i in range(m):
			if a[l + i] != b[i]:
				cnt += 1
		if cnt % 2 == 0:
			ans += 1
	return ans
	return

def main():
	a = input()
	b = input()
	n = len(a)
	m = len(b)
	bParityChanges = 0
	for i in range(1, m):
		if b[i] != b[i - 1]:
			bParityChanges += 1
			bParityChanges %= 2
	ipmm = 0
	for i in range(m):
		if a[i] != b[i]:
			ipmm += 1
			ipmm %= 2
	ans = 0
	cP = ipmm
	for l in range(n):
		r = l + m - 1
		if r == n:
			break
		if cP == 0:
			ans += 1
		cP += bParityChanges
		cP %= 2
		if b[0] != a[l]:
			cP ^= 1
		if r + 1 < n and b[m - 1] != a[r + 1]:
			cP ^= 1
	print(ans)
	return
import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(l, r):
	print('? {} {}'.format(l, r))
	sys.stdout.flush()
	return int(input())

def answerInteractive(x):
	print('! {}'.format(x))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
from math import gcd, floor, ceil
for _abc in range(1):
	main()


from sys import setcheckinterval, stdin
setcheckinterval(1000)
iin = lambda : int(stdin.readline())
lin = lambda : list(map(int, stdin.readline().split()))
txt = [int(i) for i in input()]
pat = [int(i) for i in input()]
ch1 = sum(pat) % 2
lt = len(txt)
lp = len(pat)
for i in range(1, lt):
	txt[i] += txt[i - 1]
ans = 0
txt.append(0)
for i in range(lp - 1, lt):
	if (txt[i] - txt[i - lp]) % 2 == ch1:
		ans += 1
print(ans)


(s1, s2) = [input(), input()]
(l1, l2) = [len(s1), len(s2)]
(cnt1, cnt2, l, p, ans) = [0, 0, 0, 0, 0]
for i in s2:
	if i == '1':
		cnt2 += 1
	l += 1
for i in range(0, l1):
	if s1[i] == '1':
		cnt1 += 1
	p += 1
	if p > l2:
		if s1[i - l2] == '1':
			cnt1 -= 1
	if p >= l2:
		if abs(cnt1 - cnt2) % 2 == 0:
			ans += 1
print(ans)


a = input()
b = input()
n = len(a)
m = len(b)
c = 0
e = 0
o = 0
for i in range(m):
	if a[i] != b[i]:
		c += 1
if c % 2 == 0:
	e += 1
else:
	o += 1
for i in range(n - m):
	if a[i] == a[i + m]:
		if c % 2 == 0:
			e += 1
		else:
			o += 1
	elif c % 2 == 0:
		o += 1
		c = 1
	else:
		e += 1
		c = 0
print(e)


a = input()
b = input()
c = 0
for i in range(1, len(b)):
	if b[i] != b[i - 1]:
		c += 1
s = 0
for i in range(len(b)):
	if a[i] != b[i]:
		s += 1
ans = int(s & 1 == 0)
for i in range(len(a) - len(b)):
	s += c
	if a[i] != b[0]:
		s += 1
	if a[i + len(b)] != b[-1]:
		s += 1
	ans += int(s & 1 == 0)
print(ans)


a = input()
b = input()
tot = 0
ans = 0
for i in b:
	if i is '1':
		tot += 1
pre = [0] * 1000005
for i in range(len(a)):
	if a[i] == '1':
		pre[i] += 1
	if i is not 0:
		pre[i] += pre[i - 1]
for i in range(len(b) - 1, len(a)):
	if tot % 2 == (pre[i] - pre[i - len(b)]) % 2:
		ans += 1
print(ans)


a = input()
b = input()
(l_a, l_b) = (len(a), len(b))
sub = []
ans = 0
b_c = b.count('1')
count_a = [0] * (l_a + 1)
for i in range(l_a):
	count_a[i + 1] = count_a[i] + (a[i] == '1')
for i in range(l_a - l_b + 1):
	ans += (count_a[i + l_b] - count_a[i] + b_c) % 2 == 0
print(ans)


a = list(input())
b = list(input())
cnt1 = 0
cnt2 = b.count('1')
ans = 0
for i in range(len(b)):
	if a[i] == '1':
		cnt1 += 1
if (cnt2 - cnt1) % 2 == 0:
	ans += 1
for i in range(len(b), len(a)):
	if a[i] == '1':
		cnt1 += 1
	if a[i - len(b)] == '1':
		cnt1 -= 1
	if (cnt1 + cnt2) % 2 == 0:
		ans += 1
print(ans)


a = input()
b = input()
i = 0
j = len(b)
dp = []
co = b.count('1')
po1 = [[0, 0]]
for j in range(1, len(a) + 1):
	if a[j - 1] == '1':
		po1.append([po1[-1][0] + 1, po1[-1][1]])
	else:
		po1.append([po1[-1][0], po1[-1][1] + 1])
po1.pop(0)
i = 0
j = i + len(b) - 1
ans = 0
while j < len(a):
	if i == 0:
		coun1 = po1[j][0]
		i += 1
		j += 1
		if co % 2 == coun1 % 2:
			ans += 1
	else:
		coun1 = po1[j][0] - po1[i - 1][0]
		i += 1
		j += 1
		if co % 2 == coun1 % 2:
			ans += 1
print(ans)


a = input()
b = input()
cnt = 0
cntb = 0
for i in range(len(b)):
	if i + 1 < len(b):
		if b[i] != b[i + 1]:
			cntb += 1
	if a[i] != b[i]:
		cnt += 1
ans = 0
for i in range(len(a) - len(b) + 1):
	if cnt % 2 == 0:
		ans += 1
	if i + len(b) < len(a):
		cnt += cntb
		if a[i] != b[0]:
			cnt += 1
		if a[i + len(b)] != b[-1]:
			cnt += 1
print(ans)


s1 = input()
s2 = input()
l1 = len(s1)
l2 = len(s2)
output = 0
cntb = 0
cntc = 0
for i in range(l2):
	if s1[i] == '1':
		cntb += 1
	if s2[i] == '1':
		cntc += 1
if cntb % 2 == cntc % 2:
	output += 1
for j in range(l2, l1):
	if s1[j] == '1':
		cntb += 1
	if s1[j - l2] == '1':
		cntb -= 1
	if cntb % 2 == cntc % 2:
		output += 1
print(output)


str1 = input()
str2 = input()
dl1 = len(str1)
dl2 = len(str2)
cntone = 0
cnttwo = 0
cycle = 0
rez = 0
for i in str2:
	if i == '1':
		cnttwo += 1
for i in str1:
	if i == '1':
		cntone += 1
	cycle += 1
	if cycle >= dl2:
		break
if (cnttwo + cntone) % 2 == 0:
	rez += 1
cycle = 0
if dl1 > dl2:
	for i in range(dl2, dl1):
		if str1[i - dl2] == '1':
			cntone -= 1
		if str1[i] == '1':
			cntone += 1
		cycle += 1
		if (cnttwo + cntone) % 2 == 0:
			rez += 1
print(rez)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
stra = [int(k) for k in input()]
strb = [int(k) for k in input()]
n = len(stra)
m = len(strb)
par = sum(strb) % 2
count = 0
for s in range(m):
	count += stra[s]
count = count % 2
ans = 0
if (par + count) % 2 == 0:
	ans += 1
for s in range(m, n):
	count -= stra[s - m]
	count += stra[s]
	if (par + count) % 2 == 0:
		ans += 1
print(ans)


a = input()
b = input()
ans = 0
(cnt0, cnt1) = (0, 0)
(tar0, tar1) = (0, 0)
la = len(a)
lb = len(b)
for i in b:
	if i == '0':
		tar0 += 1
	else:
		tar1 += 1
for i in range(lb):
	if a[i] == '0':
		cnt0 += 1
	else:
		cnt1 += 1
if abs(cnt1 - tar1) % 2 == 0:
	ans += 1
for i in range(lb, la):
	if a[i] == '0':
		cnt0 += 1
	else:
		cnt1 += 1
	if a[i - lb] == '0':
		cnt0 -= 1
	else:
		cnt1 -= 1
	if abs(cnt1 - tar1) % 2 == 0:
		ans += 1
print(ans)


a = input()
b = input()
(a1, b1) = (0, 0)
res = 0
for i in b:
	if i == '1':
		b1 += 1
ai = a[:len(b)]
for i in ai:
	if i == '1':
		a1 += 1
if (a1 - b1) % 2 == 0:
	res += 1
for i in range(len(a) - len(b)):
	if a[i] == '1':
		a1 += 1
	if a[i + len(b)] == '1':
		a1 += 1
	if (a1 - b1) % 2 == 0:
		res += 1
print(res)


from decimal import *
import sys, os, io
from sys import stdin
from math import log, gcd, ceil
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import math
sys.setrecursionlimit(100000)
alphabets = list('abcdefghijklmnopqrstuvwxyz')

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	c = dict(Counter(l))
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def sieveForSmallestPrimeFactor():
	MAXN = 100001
	spf = [0 for i in range(MAXN)]
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, math.ceil(math.sqrt(MAXN))):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
	return spf

def getPrimeFactorizationLOGN(x):
	spf = sieveForSmallestPrimeFactor()
	ret = list()
	while x != 1:
		ret.append(spf[x])
		x = x // spf[x]
	return ret

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	pr = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for i in range(2, len(prime)):
		if prime[i]:
			pr.append(i)
	return pr

def si():
	return input()

def divideCeil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	a = list(si())
	b = list(si())
	cntb = b.count('1')
	ans = 0
	i = 0
	s = a[:len(b)].count('1')
	for i in range(len(a)):
		if s % 2 == cntb % 2:
			ans += 1
		if i + len(b) >= len(a):
			break
		if a[i + len(b)] == '1':
			s += 1
		if a[i] == '1':
			s -= 1
	print(ans)
t = 1
for _ in range(t):
	solve()


a = list(input())
b = list(input())
ctb = b.count('1')
n = len(b)
cta = a[:n].count('1')
m = len(a)
s = 0
for i in range(n - 1, m):
	if (cta + ctb) % 2 == 0:
		s += 1
	if i != m - 1:
		if a[i + 1] == '1':
			cta += 1
		if a[i - n + 1] == '1':
			cta -= 1
print(s)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
a = input()
b = input()
b1 = b.count('1')
pre = [0]
for i in a:
	pre.append(pre[-1])
	if i == '1':
		pre[-1] += 1
c = 0
for i in range(len(b), len(a) + 1):
	d = pre[i] - pre[i - len(b)]
	if d % 2 == b1 % 2:
		c += 1
print(c)


a = input()
b = input()
l = len(b)
d = 0
n = 0
e = 0
for i in range(l - 1):
	if b[i] != b[i + 1]:
		d = 1 - d
for i in range(l):
	if a[i] != b[i]:
		e = 1 - e
if not e:
	n += 1
for i in range(len(a) - l):
	if a[i + l] != b[-1]:
		e = 1 - e
	if a[i] != b[0]:
		e = 1 - e
	if d:
		e = 1 - e
	if not e:
		n += 1
print(n)


a = input()
b = input()
la = len(a)
lb = len(b)
cb = b.count('1')
ans = 0
arr = [0 for i in range(la + 1)]
for i in range(1, la + 1):
	arr[i] += arr[i - 1] + int(a[i - 1])
for i in range(lb, la + 1):
	ans += 1 - (arr[i] - arr[i - lb] - cb) % 2
print(ans)


a = input()
b = input()
c = 0
d = 0
for i in range(len(b)):
	if b[i] == '1':
		c = c + 1
ans = 0
for i in range(len(b) - 1):
	if a[i] == '1':
		d = d + 1
for i in range(len(a) - len(b) + 1):
	if a[i + len(b) - 1] == '1':
		d = d + 1
	if d % 2 == c % 2:
		ans = ans + 1
	if a[i] == '1':
		d = d - 1
print(ans)


(a, b) = (input(), input())
bnb = b.count('1') % 2
prefix = [int(a[0])]
for i in range(1, len(a)):
	if a[i] == '1':
		prefix.append(prefix[-1] + 1)
	else:
		prefix.append(prefix[-1])
(lb, la) = (len(b), len(a))
tot = 1 if bnb == prefix[lb - 1] % 2 else 0
for j in range(lb, la):
	pref = prefix[j] - prefix[j - lb]
	if pref % 2 == bnb:
		tot += 1
print(tot)


a = input()
b = input()
la = len(a)
lb = len(b)
count = 0
s = [0] * (la + 1)
sb = b.count('1')
for i in range(0, la):
	s[i + 1] = s[i] + (a[i] == '1')
for i in range(la - lb + 1):
	count += (s[i + lb] - s[i] - sb) % 2 == 0
print(count)


c = input()
d = input()
current_count_ones_in_c = len([x for x in c[:len(d)] if x == '1'])
count_ones_in_d = len([x for x in d if x == '1'])
answer = int(count_ones_in_d % 2 == current_count_ones_in_c % 2)
for i in range(len(d), len(c)):
	current_count_ones_in_c += int(c[i] == '1') - int(c[i - len(d)] == '1')
	answer += int(count_ones_in_d % 2 == current_count_ones_in_c % 2)
print(answer)


big_string = input()
small_string = input()
curr_count = big_string[:len(small_string)].count('1')
template_count = small_string.count('1')
ans = abs(template_count - curr_count + 1) % 2
l_cl = 0
r_cl = len(small_string) - 1
while True:
	r_cl += 1
	l_cl += 1
	if r_cl >= len(big_string):
		break
	if big_string[r_cl] == '1':
		curr_count += 1
	if big_string[l_cl - 1] == '1':
		curr_count -= 1
	ans += abs(curr_count - template_count + 1) % 2
print(ans)


A = input()
B = input()
B_zeros = 0
for i in range(len(B)):
	if B[i] == '0':
		B_zeros += 1
L_B = len(B)
zeros = 0
res = 0
for i in range(len(A)):
	if A[i] == '0':
		zeros += 1
	if i == L_B - 1:
		do = 1
	elif i > L_B - 1:
		if A[i - L_B] == '0':
			zeros -= 1
	if i >= L_B - 1:
		if (zeros - B_zeros) % 2 == 0:
			res += 1
print(res)


a = list(map(int, list(input())))
b = list(map(int, list(input())))
n = len(b)
acc_b = sum(b) % 2
acc_a = sum(a[:n]) % 2
cnt = 0 if acc_a ^ acc_b else 1
for i in range(n, len(a)):
	acc_a = acc_a ^ a[i] ^ a[i - n]
	cnt += 0 if acc_a ^ acc_b else 1
print(cnt)


a = input()
b = input()
pref = [0] * (len(a) - 1)
pyk = 0
for i in range(len(a) - 1):
	if a[i] != a[i + 1]:
		pyk += 1
		pref[i] = pyk
	else:
		pref[i] = pyk
chuj = 0
res = 0
for i in range(len(b)):
	if a[i] != b[i]:
		chuj += 1
tesame = 1
dupa = 1
for i in range(len(a) - len(b)):
	if i > 0:
		if (pref[i + len(b) - 1] - pref[i - 1]) % 2 != 0:
			dupa = 1 - dupa
		tesame += dupa
	else:
		if pref[i + len(b) - 1] % 2 != 0:
			dupa = 1 - dupa
		tesame += dupa
if chuj % 2 == 0:
	print(tesame)
else:
	print(len(a) - len(b) + 1 - tesame)


import sys

def input():
	return sys.stdin.readline().rstrip()

def slv():
	a = list(map(int, list(input())))
	b = list(map(int, list(input())))
	n = len(a)
	m = len(b)
	sign = 0
	for i in range(m - 1):
		if b[i] != b[i + 1]:
			sign ^= 1
	ans = 0
	dif = 0
	for i in range(m):
		if a[i] != b[i]:
			dif ^= 1
	if dif == 0:
		ans += 1
	for i in range(n - m):
		if sign:
			dif ^= 1
		if a[m + i] != b[-1]:
			dif ^= 1
		if a[i] != b[0]:
			dif ^= 1
		if dif == 0:
			ans += 1
	print(ans)
	return

def main():
	t = 1
	for i in range(t):
		slv()
	return
main()


from collections import Counter
import string
import bisect
import random
import math
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
testcases = 1
for _ in range(testcases):
	s = [int(i) for i in input()]
	s2 = input()
	ones = s2.count('1')
	ans = 0
	ans += 1 if sum(s[0:len(s2)]) % 2 == ones % 2 else 0
	k = 0
	value = sum(s[0:len(s2)])
	for i in range(len(s) - len(s2)):
		value += s[i + len(s2)] - s[i]
		ans += 1 if value % 2 == ones % 2 else 0
	print(ans)


a = str(input())
b = str(input())
n = len(a)
unos = [0] * (n + 1)
m = len(b)
tot = 0
for el in b:
	tot += int(el)
tot = tot % 2
s = 0
c = 0
for r in range(1, n + 1):
	s += int(a[r - 1])
	unos[r] = s
	if r >= m and (unos[r] - unos[r - m]) % 2 == tot:
		c += 1
print(c)


import sys
s1 = input()
s2 = input()
(n1, n2) = (0, 0)
for i in range(len(s2)):
	n1 += 1 if s1[i] == '1' else 0
	n2 += 1 if s2[i] == '1' else 0
res = 1 if n1 & 1 == n2 & 1 else 0
for i in range(len(s2), len(s1)):
	if s1[i] == '1':
		n1 += 1
	if s1[i - len(s2)] == '1':
		n1 -= 1
	res += 1 if n1 & 1 == n2 & 1 else 0
print(res)


a = input()
b = input()
q = 0
for i in b:
	if i == '1':
		q += 1
value = [0] * (len(a) + 1)
lenb = len(b)
ans = 0
for i in range(len(a)):
	value[i + 1] = value[i] + bool(a[i] == '1')
	if i + 1 >= lenb and (abs(value[i + 1] - value[i + 1 - lenb]) - q) % 2 == 0:
		ans += 1
print(ans)


s = input()
t = input()
(l, r) = (0, len(t))
sums = 0
tsum = 0
for i in range(len(t)):
	if t[i] == '1':
		tsum += 1
while l < r:
	if s[l] == '1':
		sums += 1
	l += 1
l = 0
ans = 0
while True:
	if sums % 2 == tsum % 2:
		ans += 1
	if r == len(s):
		break
	if s[l] == '1':
		sums -= 1
	if s[r] == '1':
		sums += 1
	l += 1
	r += 1
print(ans)


s = input()
t = input()
sum = 0
for c in t:
	if c == '1':
		sum += 1
sum2 = 0
ans = 0
for i in range(0, len(s)):
	if s[i] == '1':
		sum2 += 1
	if i >= len(t) and s[i - len(t)] == '1':
		sum2 -= 1
	if i >= len(t) - 1 and sum % 2 == sum2 % 2:
		ans += 1
print(ans)


import sys
a = list(map(int, input()))
b = list(map(int, input()))
for i in range(1, len(a)):
	a[i] += a[i - 1]
b_sum = sum(b)
ans = 0
ans += a[len(b) - 1] % 2 == b_sum % 2
for i in range(len(b), len(a)):
	ans += (a[i] - a[i - len(b)]) % 2 == b_sum % 2
print(ans)


(b, c) = (input(), input())
lb = len(b)
lc = len(c)
ans = cnt = 0
for i in range(lc):
	if b[i] == '1':
		cnt += 1
	if c[i] == '1':
		cnt += 1
if cnt % 2 == 0:
	ans = 1
for i in range(lc, lb):
	if b[i] == '1':
		cnt += 1
	if b[i - lc] == '1':
		cnt -= 1
	if cnt % 2 == 0:
		ans += 1
print(ans)


a = input()
b = input()
al = len(a)
bl = len(b)
import sys
if bl == 1:
	cnt = 0
	for i in range(al):
		if a[i] == b:
			cnt += 1
	print(cnt)
	sys.exit()
if al == bl:
	diff = 0
	for i in range(bl):
		if a[i] != b[i]:
			diff += 1
	if diff % 2 == 0:
		print(1)
	else:
		print(0)
	sys.exit()
even = True
cnt = 0
difn = 0
for i in range(bl):
	if a[i] != a[i + 1]:
		difn += 1
mv = True
for i in range(al - bl - 1):
	if difn % 2 == 1:
		mv = not mv
	if sum([int(a[q]) for q in [i, i + 1, i + bl + 1, i + bl]]) % 2 == 1:
		difn += 1
	if mv:
		cnt += 1
if difn % 2 == 1:
	mv = not mv
if mv:
	cnt += 1
diff = 0
for i in range(bl):
	if a[i] != b[i]:
		diff += 1
if diff % 2 == 0:
	print(cnt + 1)
else:
	print(al - bl - cnt)


s = input()
t = input()
n = 0
ans = 0
for i in t:
	if i == '1':
		n += 1
m = 0
for i in range(len(t)):
	if s[i] == '1':
		m += 1
for i in range(len(t), len(s)):
	if (m + n) % 2 == 0:
		ans += 1
	if s[i] != s[i - len(t)]:
		m += 1
if (m + n) % 2 == 0:
	ans += 1
print(ans)


s1 = input()
s2 = input()
(n, m) = (len(s1), len(s2))
(t, res) = (0, [0, 0])
for i in range(m):
	t ^= s1[i] == '0'
	t ^= s2[i] == '0'
res[t] += 1
for i in range(m, n):
	t ^= (s1[i] == '0') ^ (s1[i - m] == '0')
	res[t] += 1
print(res[0])


a = input()
b = input()
sum_a = sum(map(int, a[:len(b)]))
sum_b = sum(map(int, b))
count = 0
i = 0
while True:
	xor = (sum_a + sum_b + 1) % 2
	count += xor
	if i >= len(a) - len(b):
		break
	sum_a = sum_a + int(a[i + len(b)]) - int(a[i])
	i += 1
print(count)


def check(b):
	c = 0
	for i in range(len(b)):
		if b[i] == '1':
			c += 1
	return c
a = input()
b = input()
c1 = check(b)
c = [0] * (len(a) + 1)
c[1] = int(a[0])
c[0] = 0
ans = 0
for i in range(2, len(a) + 1):
	c[i] = c[i - 1] + int(a[i - 1])
for i in range(len(b), len(a) + 1):
	t = c[i] - c[i - len(b)]
	if abs(t - c1) % 2 == 0:
		ans += 1
print(ans)


s = input()
b = input()
n = len(b)
(c, t) = (0, 0)
for i in range(n):
	if b[i] == '0':
		c += 1
	if s[i] == '0':
		t += 1
f = 0
if (t - c) % 2 == 0:
	f += 1
for i in range(n, len(s)):
	if s[i - n] == '0':
		t -= 1
	if s[i] == '0':
		t += 1
	if (t - c) % 2 == 0:
		f += 1
print(f)


a = list(map(int, list(input())))
b = list(map(int, list(input())))
val = sum(b) % 2
ind = 0
start = sum(a[:len(b)])
out = (val + start + 1) % 2
while ind < len(a) - len(b):
	start += a[ind + len(b)] - a[ind]
	out += (val + start + 1) % 2
	ind += 1
print(out)


a = [0] + [int(i) for i in input()]
b = [int(i) for i in input()]
(l1, l2) = (len(a), len(b))
b1 = sum(b) % 2
for i in range(1, l1):
	a[i] += a[i - 1]
res = 0
for i in range(l2, l1):
	c = a[i] - a[i - l2]
	res += c % 2 ^ b1 == 0
print(res)


a = input()
b = input()
i = b.count('1')
s = [0 for k in range(len(a))]
if a[0] == '1':
	s[0] = 1
for k in range(1, len(a)):
	if a[k] == '1':
		s[k] = s[k - 1] + 1
	else:
		s[k] = s[k - 1]
s = s + [0]
ans = 0
for k in range(len(a) - len(b) + 1):
	t = s[k + len(b) - 1] - s[k - 1]
	if i % 2 == t % 2:
		ans += 1
print(ans)


s1 = input()
s2 = input()
ans = 0
tot = 0
for i in range(len(s2)):
	tot += s1[i] != s2[i]
ans += tot % 2 == 0
for i in range(len(s2), len(s1)):
	tot += s1[i] != s1[i - len(s2)]
	ans += tot % 2 == 0
print(ans)


(a, b) = (input(), input())
t = 0
l = [0, 0]
for i in range(len(b)):
	t ^= int(a[i]) ^ int(b[i])
l[t] = 1
for i in range(len(b), len(a)):
	t ^= int(a[i]) ^ int(a[i - len(b)])
	l[t] += 1
print(l[0])


a = input()
b = input()
(b1, b0) = (0, 0)
(a1, a0) = (0, 0)
ans = 0
preNum = a[0]
for i in range(len(b)):
	if b[i] == '1':
		b1 += 1
	else:
		b0 += 1
	if a[i] == '1':
		a1 += 1
	else:
		a0 += 1
if (a1 - b1) % 2 == 0:
	ans += 1
for i in range(len(b), len(a)):
	if a[i] == '1':
		a1 += 1
	else:
		a0 += 1
	if preNum == '1':
		a1 -= 1
	else:
		a0 -= 1
	preNum = a[i - len(b) + 1]
	if (a1 - b1) % 2 == 0:
		ans += 1
print(ans)


import sys
input = sys.stdin.readline
(a, b, res, ca, cb) = (input()[:-1], input()[:-1], 0, 0, 0)
(lb, la) = (len(b), len(a))
for i in range(lb):
	if a[i] == '1':
		ca += 1
	if b[i] == '1':
		cb += 1
if ca % 2 == cb % 2:
	res += 1
for i in range(lb, la):
	if a[i] == '1':
		ca += 1
	if a[i - lb] == '1':
		ca += 1
	if ca % 2 == cb % 2:
		res += 1
print(res)


def main():
	a = input()
	b = input()
	suma = [0 for i in range(len(a) + 1)]
	for i in range(1, 1 + len(a)):
		suma[i] = suma[i - 1] + (a[i - 1] == '1')
	sumb = 0
	for i in range(len(b)):
		sumb += b[i] == '1'
	ans = 0
	for i in range(len(b), len(a) + 1):
		if (suma[i] - suma[i - len(b)]) % 2 == sumb % 2:
			ans += 1
	print(ans)
main()


import math

def main():
	a = input()
	b = input()
	c = a[:len(b)]
	cnt = 0
	cntd = 0
	ans = 0
	for i in c:
		if i == '1':
			cnt += 1
	for i in b:
		if i == '1':
			cntd += 1
	if cnt % 2 == cntd % 2:
		ans += 1
	for i in range(len(b), len(a)):
		if a[i] == '1':
			cnt += 1
		if a[i - len(b)] == '1':
			cnt -= 1
		if cnt % 2 == cntd % 2:
			ans += 1
	print(ans)
main()


a = [int(x) for x in input()]
b = [int(x) for x in input()]
n = len(a) + 1
m = len(b)
s = [0 for _ in range(n)]
for i in range(1, n):
	s[i] = s[i - 1] + a[i - 1]
k = sum(b) % 2
ans = 0
for i in range(m, n):
	if (s[i] - s[i - m]) % 2 == k:
		ans += 1
print(ans)


a = input()
b = input()
c = 0
qw = (len(b) - a[:len(b)].count('0') + b.count('1')) % 2
if qw % 2 == 0:
	c = c + 1
for i in range(len(b), len(a)):
	if a[i] == '0':
		qw = qw + 1
	if a[i - len(b)] == '0':
		qw = qw - 1
	if qw % 2 == 0:
		c = c + 1
print(c)


a = input()
b = input()
bo = b.count('1')
lb = len(b)
ao = a[:lb].count('1')
final_ans = 0
if (ao + bo) % 2 == 0:
	final_ans += 1
for i in range(len(a) - lb):
	if a[i] == '1':
		ao -= 1
	if a[i + lb] == '1':
		ao += 1
	if (ao + bo) % 2 == 0:
		final_ans += 1
print(final_ans)


a = [int(x) for x in list(input())]
b = [int(x) for x in list(input())]
n = len(b)
counter = odd = answer = 0
for i in range(n):
	if a[i] != b[i]:
		counter += 1
	if i != n - 1 and a[i] != a[i + 1]:
		odd += 1
if counter % 2 == 0:
	flag = True
	answer += 1
else:
	flag = False
odd %= 2
for i in range(n, len(a)):
	if a[i] != a[i - 1]:
		odd += 1
		odd = odd % 2
	if odd == 0:
		if flag:
			answer += 1
	elif flag:
		flag = False
	else:
		answer += 1
		flag = True
	if a[i - n] != a[i - n + 1]:
		odd += 1
		odd %= 2
print(answer)


(a, b) = (input(), input())
ans = t = 0
for i in range(len(b)):
	t += a[i] != b[i]
ans += t % 2 == 0
for i in range(len(b), len(a)):
	t += a[i] != a[i - len(b)]
	ans += t % 2 == 0
print(ans)


a = input()
b = input()
c1 = b.count('1')
c2 = a[:len(b)].count('1')
ans = 0
if (c1 - c2) % 2 == 0:
	ans += 1
x = len(b)
for i in range(x, len(a)):
	if a[i] == '1':
		c2 += 1
	if a[i - x] == '1':
		c2 -= 1
	if (c1 + c2) % 2 == 0:
		ans += 1
print(ans)


import sys, math, queue, bisect
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
a = list(map(int, list(input())))
b = list(map(int, list(input())))
n = len(a)
m = len(b)
a.append(0)
b = sum(b)
for i in range(1, n):
	a[i] += a[i - 1]
ans = 0
for i in range(n - m + 1):
	if (a[i + m - 1] - a[i - 1] + b) % 2 == 0:
		ans += 1
print(ans)


(a, b) = (input(), input())
array = [0]
for i in range(len(a)):
	array.append(array[-1] + a[i].count('1'))

def f(a, b):
	return array[b] - array[a]
d = b.count('1')
s = 0
for i in range(len(b), len(a) + 1):
	s += 1 - f(i - len(b), i) % 2 ^ d % 2
print(s)


a = input()
b = input()
n = len(a)
m = len(b)

def change(a):
	pref = [0] * len(a)
	for i in range(1, len(a)):
		pref[i] = pref[i - 1] + (a[i] != a[i - 1])
	return pref
equals = 0
pref = change(a)
for i in range(m):
	equals += a[i] != b[i]
parity = equals % 2
f = int(not parity)
for i in range(m, n):
	parity += (pref[i] - pref[i - m]) % 2
	f += parity % 2 == 0
print(f)


A = input()
B = input()
n = len(A)
m = len(B)
cntb = 0
for i in range(m):
	if B[i] == '1':
		cntb += 1
A = list(A)
A = [int(c) for c in A]
from itertools import accumulate
C = [0] + A
C = list(accumulate(C))
ans = 0
for i in range(n - m + 1):
	cnta = C[i + m] - C[i]
	if cnta % 2 == cntb % 2:
		ans += 1
print(ans)


a = input()
b = input()
l1 = len(a)
l2 = len(b)
count = 0
ct = 0
for i in range(l2):
	if a[i] == '0':
		ct += 1
	if b[i] == '0':
		ct += 1
if ct % 2 == 0:
	count += 1
for i in range(l2, l1):
	if a[i] == '0':
		ct += 1
	if a[i - l2] == '0':
		ct -= 1
	if ct % 2 == 0:
		count += 1
print(count)


from sys import stdin, stdout, exit
a = stdin.readline().strip()
b = stdin.readline().strip()
n = len(a)
m = len(b)
b_flips = 0
for i in range(m - 1):
	if b[i] != b[i + 1]:
		b_flips += 1
diff = 0
cur = 0
for i in range(m):
	if a[i] != b[i]:
		cur += 1
		cur %= 2
if cur % 2 == 0:
	diff += 1
for i in range(n - m):
	cur += b_flips
	cur %= 2
	if a[i] != b[0]:
		cur += 1
		cur %= 2
	if a[i + m] != b[m - 1]:
		cur += 1
		cur %= 2
	if cur % 2 == 0:
		diff += 1
print(diff)


a = input()
b = input()
len_a = len(a)
len_b = len(b)
cntb = 0
for i in range(len_b):
	cntb += int(b[i])
cnta = 0
for i in range(len_b):
	cnta += int(a[i])
answer = int(cnta % 2 == cntb % 2)
for i in range(len_b, len_a):
	cnta += int(a[i]) - int(a[i - len_b])
	answer += int(cnta % 2 == cntb % 2)
print(answer)


a = input()
b = input()
A = [0]
Hash = 0
for i in a:
	if i == '1':
		A.append(A[-1] + 1)
	else:
		A.append(A[-1])
for i in b:
	if i == '1':
		Hash += 1
res = 0
for i in range(1, len(a) - len(b) + 2):
	if (A[i + len(b) - 1] - A[i - 1]) % 2 == Hash % 2:
		res += 1
print(res)


r = input()
n = input()
length = len(n)
g = n.count('1')
same = False
nums = 0
if len(r) < length:
	print(0)
else:
	if (r[:len(n)].count('1') - g) % 2 == 0:
		same = True
		nums += 1
	for i in range(len(r) - len(n)):
		if r[i] != r[i + len(n)]:
			same = not same
		if same:
			nums += 1
print(nums)


a = input()
b = input()
na = len(a)
nb = len(b)
cntc = cntb = 0
for i in range(nb):
	if b[i] == '1':
		cntb += 1
	if a[i] == '1':
		cntc += 1
ans = 0
if cntb % 2 == cntc % 2:
	ans += 1
for i in range(1, na):
	if i + nb > na:
		break
	else:
		if a[i - 1] == '1':
			cntc -= 1
		if a[i + nb - 1] == '1':
			cntc += 1
		if cntb % 2 == cntc % 2:
			ans += 1
print(ans)


from functools import reduce
from operator import xor
a = [*map(int, input())]
b = [*map(int, input())]
n = len(b)
curr = reduce(xor, b)
curr ^= reduce(xor, a[:n])
res = int(curr & 1 == 0)
for i in range(n, len(a)):
	curr ^= a[i] ^ a[i - n]
	res += curr & 1 == 0
print(res)


a = input()
b = input()
len_a = len(a)
len_b = len(b)
n = len_a - len_b + 1
sum_a = 0
sum_b = 0
cnt = 0
for i in range(len_b):
	sum_a += int(a[i])
	sum_b += int(b[i])
for i in range(n - 1):
	if (sum_a + sum_b) % 2 == 0:
		cnt += 1
	sum_a -= int(a[i])
	sum_a += int(a[len_b + i])
if (sum_a + sum_b) % 2 == 0:
	cnt += 1
print(cnt)