#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string a, b;
  cin >> a >> b;
  int asz = a.size(), bsz = b.size();
  vector<long long> ones(bsz + 2);
  ones[0] = 0;
  for (int i = 1; i <= bsz; i++) {
    ones[i] = b[i - 1] - '0' + ones[i - 1];
  }
  long long dist = 0;
  for (int i = 0; i < asz; i++) {
    if (a[i] == '0') {
      dist += ones[bsz - asz + i + 1] - ones[i];
    } else {
      dist += bsz - asz + 1 - (ones[bsz - asz + i + 1] - ones[i]);
    }
  }
  cout << dist << endl;
  return 0;
}
