#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
int main() {
  string a, b;
  cin >> a >> b;
  int n = b.length(), m = a.length();
  vector<int> pref(n + 1, 0);
  vector<int> nab(n + 1);
  for (int i = 1; i <= n; i++) {
    if (b[i - 1] == '1')
      nab[i] = 1;
    else
      nab[i] = 0;
  }
  for (int i = 1; i <= n; i++) {
    pref[i] = pref[i - 1] + nab[i];
  }
  long long sol = 0;
  for (int i = 1; i <= m; i++) {
    if (a[i - 1] == '0') {
      sol += 1LL * pref[n - m + i] - pref[i - 1];
    } else {
      sol += 1LL * (n - m + 1) - (pref[n - m + i] - pref[i - 1]);
    }
  }
  cout << sol << endl;
  return 0;
}
