#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double EX = 2.7182818284;
const int MOD = 1e9 + 7;
const int oo = 2e9 + 1e8;
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
int main() {
  string a, b;
  long long ans = 0;
  cin >> a >> b;
  if ((int)a.size() > (int)b.size()) {
    puts("0");
    return 0;
  }
  vector<pair<int, int>> have((int)b.size());
  if (b[0] - '0')
    have[0].second = 1;
  else
    have[0].first = 1;
  for (long long i = (long long)1; i < (long long)(int)b.size(); i++) {
    have[i] = make_pair(have[i - 1].first, have[i - 1].second);
    if (b[i] - '0')
      have[i].second++;
    else
      have[i].first++;
  }
  for (long long i = 0; i < (long long)(int)a.size(); i++) {
    if (a[i] - '0') {
      if (!i)
        ans += have[(int)b.size() - (int)a.size()].first;
      else
        ans +=
            have[(int)b.size() - (int)a.size() + i].first - have[i - 1].first;
    } else {
      if (!i)
        ans += have[(int)b.size() - (int)a.size()].second;
      else
        ans +=
            have[(int)b.size() - (int)a.size() + i].second - have[i - 1].second;
    }
  }
  cout << ans << endl;
  return 0;
}
