#include <bits/stdc++.h>
using namespace std;
char a[200002], b[200002];
int main() {
  cin >> a >> b;
  int l = strlen(b);
  int z[l + 1];
  z[0] = 0;
  if (b[0] == '0') {
    z[1] = 1;
  } else
    z[1] = 0;
  for (int i = 1; i < l; i++) {
    if (b[i] == '0') {
      z[i + 1] = z[i] + 1;
    } else
      z[i + 1] = z[i];
  }
  long long int sum = 0;
  int la = strlen(a);
  for (int i = 0; i < la; i++) {
    if (a[i] == '0') {
      sum += abs(((l - la + i + 1) - z[l - la + (i + 1)]) - ((i)-z[i]));
    } else
      sum += z[l - la + i + 1] - z[i];
  }
  cout << sum << endl;
  return 0;
}
