#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int p0[N];
int p1[N];
int main() {
  string a;
  cin >> a;
  string b;
  cin >> b;
  for (int i = 0; i < a.length(); i++) {
    p0[i] = (a[i] == '0');
    p1[i] = (a[i] == '1');
    if (i) {
      p0[i] += p0[i - 1];
      p1[i] += p1[i - 1];
    }
  }
  long long ans = 0;
  for (int i = 0; i < b.length(); i++) {
    int y = min((int)a.length() - 1, i);
    int x = max(0, (int)a.length() - ((int)b.length() - i));
    if (b[i] == '0') {
      ans += p1[y];
      if (x) ans -= p1[x - 1];
    } else {
      ans += p0[y];
      if (x) ans -= p0[x - 1];
    }
  }
  cout << ans << endl;
}
