#include <bits/stdc++.h>
const double EPS = 0.0000001;
using namespace std;
string a, b;
int z[300000], o[300000];
int main() {
  ios::sync_with_stdio(0);
  cin >> a >> b;
  if (a[0] == '1')
    o[0] = 1;
  else
    z[0] = 1;
  for (int i = 1; i < a.size(); i++) {
    o[i] += o[i - 1];
    z[i] += z[i - 1];
    if (a[i] == '1')
      o[i]++;
    else
      z[i]++;
  }
  long long ans = 0;
  int n = a.size(), m = b.size();
  int l, r;
  for (int i = 0; i < m; i++) {
    l = min(n - 1, i);
    r = max(0, n - (m - i));
    if (b[i] == '1') {
      ans += z[l] - z[r] + (a[r] != b[i]);
    } else {
      ans += o[l] - o[r] + (a[r] != b[i]);
    }
  }
  cout << ans << endl;
  int _____________;
  cin >> _____________;
  return 0;
}
