#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string a, b;
  cin >> a >> b;
  int L = b.length();
  vector<int> v(L, 0);
  int s = 0;
  for (int((i)) = (0); ((i)) < ((L)); ((i))++) v[i] = (s += b[i] == '1');
  long long int tot = 0;
  int asize = a.size();
  for (int((i)) = (0); ((i)) < ((a.size())); ((i))++) {
    int ones = v[L - asize + i];
    if (i != 0) ones -= v[i - 1];
    if (a[i] == '0')
      tot += ones;
    else
      tot += L - asize + 1 - ones;
  }
  cout << tot << endl;
}
