#include <bits/stdc++.h>
using namespace std;
using namespace std;
int z[200005];
int o[200005];
int main() {
  string A, B;
  cin >> A;
  cin >> B;
  int m = B.size();
  for (int i = 0; i < B.size(); i++) {
    if (B[i] == '0') {
      z[i + 1] = z[i] + 1;
      o[i + 1] = o[i];
    } else {
      z[i + 1] = z[i];
      o[i + 1] = o[i] + 1;
    }
  }
  long long ans = 0;
  int n = A.size();
  for (int i = 0; i < n; i++) {
    if (A[i] == '0') {
      ans += o[m - n + i + 1] - o[i];
    } else {
      ans += z[m - n + i + 1] - z[i];
    }
  }
  printf("%lld\n", ans);
}
