#include <bits/stdc++.h>
using namespace std;
char a[200005], b[200005];
int r1[200005], r0[200005];
int main() {
  while (scanf("%s%s", a + 1, b + 1) != EOF) {
    int al = strlen(a + 1);
    int bl = strlen(b + 1);
    for (int i = 1; i <= bl; i++) {
      r1[i] = r1[i - 1] + (b[i] == '1');
      r0[i] = r0[i - 1] + (b[i] == '0');
    }
    long long sum = 0;
    for (int i = 1; i <= al; i++) {
      if (a[i] == '1')
        sum += r0[bl - al + i] - r0[i - 1];
      else
        sum += r1[bl - al + i] - r1[i - 1];
    }
    printf("%I64d\n", sum);
  }
  return 0;
}
