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