#include <bits/stdc++.h>
using namespace std;
long long x[200005] = {};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string a, b;
  cin >> a >> b;
  x[0] = b[0] - '0';
  for (__typeof(b.size() - 1) i = (1); i <= (b.size() - 1); ++i)
    x[i] = x[i - 1] + (b[i] - '0');
  long long ans = 0LL, lna = (long long)a.size(), lnb = (long long)b.size();
  for (__typeof(a.size()) i = 0; i < (a.size()); ++i) {
    long long p = lnb - lna + (long long)i;
    long long sum;
    if (i == 0)
      sum = x[p];
    else
      sum = x[p] - x[i - 1];
    if (a[i] == '0')
      ans += sum;
    else
      ans += p - (long long)i - sum + 1LL;
  }
  cout << ans << '\n';
  return 0;
}
