#include <bits/stdc++.h>
using namespace std;
int x, y, t;
char a[200020], b[200020];
int i;
long long num, ans;
int main() {
  num = ans = 0;
  cin >> a >> b;
  x = strlen(a);
  y = strlen(b);
  t = y - x + 1;
  for (i = 0; i < t; i++) {
    if (b[i] == '1') num++;
  }
  for (i = 0; i < x; i++) {
    if (a[i] == '0')
      ans += num;
    else
      ans += t - num;
    if (b[i] == '1') num--;
    if (b[i + t] == '1') num++;
  }
  cout << ans << endl;
  return 0;
}
