#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 11;
int n, m;
int sum[maxn];
char a[maxn], b[maxn];
void init() {
  for (int i = 1; i <= m; ++i) {
    sum[i] = sum[i - 1] + (b[i] == '1');
  }
}
int query(int l, int r, int val) {
  int tmp = sum[r] - sum[l - 1];
  return val == 1 ? tmp : r - l + 1 - tmp;
}
int main() {
  scanf("%s%s", a + 1, b + 1);
  n = strlen(a + 1), m = strlen(b + 1);
  init();
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    int l = i, r = m - n + i;
    ans += query(l, r, a[i] == '0');
  }
  printf("%I64d\n", ans);
  return 0;
}
