#include <bits/stdc++.h>
using namespace std;
long long n[200001], e[200001];
int main() {
  string s, t;
  cin >> s >> t;
  long long ls = s.size(), ts = t.size();
  if (ls == 1) {
    long long anss = 0;
    for (long long k = 0; k < ts; k++)
      if (t[k] != s[0]) anss++;
    cout << anss;
    return 0;
  }
  if (t[0] == '0') {
    n[0] = 1;
    e[0] = 0;
  } else {
    e[0] = 1;
    n[0] = 0;
  }
  for (long long k = 1; k < ts; k++) {
    n[k] = n[k - 1];
    e[k] = e[k - 1];
    if (t[k] == '0')
      n[k]++;
    else
      e[k]++;
  }
  long long ans = 0;
  for (long long k = 0; k < ls; k++) {
    if (s[k] == '0') {
      ans += e[ts - (ls - k)] - e[k - 1];
    } else {
      ans += n[ts - (ls - k)] - n[k - 1];
    }
  }
  cout << ans;
  return 0;
}
