#include <bits/stdc++.h>
using namespace std;
long long o[500000], z[500000];
int main() {
  long long n, m, i, j, k, l, s = 0, x, y;
  char a[500000], t[500000];
  gets(a);
  gets(t);
  l = strlen(a);
  k = strlen(t);
  if (t[0] == '1') {
    o[0] = 1;
    z[0] = 0;
  } else {
    z[0] = 1;
    o[0] = 0;
  }
  for (i = 1; i < k; i++) {
    if (t[i] == '0') {
      z[i] = z[i - 1] + 1;
      o[i] = o[i - 1];
    } else {
      o[i] = o[i - 1] + 1;
      z[i] = z[i - 1];
    }
  }
  if (a[0] == '0')
    s = o[k - l];
  else
    s = z[k - l];
  for (i = 1; i < l; i++) {
    if (a[i] == '0') {
      s += (o[k - l + i] - o[i - 1]);
    } else {
      s += (z[k - l + i] - z[i - 1]);
    }
  }
  printf("%I64d\n", s);
  return 0;
}
