#include <bits/stdc++.h>
using namespace std;
string a;
string b;
long long c00[200005];
long long c01[200005];
long long c10[200005];
long long c11[200005];
int main() {
  long long sum = 0;
  cin >> a >> b;
  long long c0 = 0, c1 = 0;
  for (long long i = 0; i <= b.size() - 1; ++i) {
    c00[i + 1] = c00[i];
    c01[i + 1] = c01[i];
    if (b[i] == '0')
      c00[i + 1]++;
    else
      c01[i + 1]++;
  }
  for (long long i = b.size() - 1; i >= 0; --i) {
    c10[i + 1] = c10[i + 2];
    c11[i + 1] = c11[i + 2];
    if (b[i] == '0')
      c10[i + 2]++;
    else
      c11[i + 2]++;
  }
  for (int i = 0; i < a.size(); ++i) {
    if (a[i] == '0') {
      sum += (c01[b.size() - a.size() + i + 1] - c01[i]);
    } else {
      sum += (c00[b.size() - a.size() + i + 1] - c00[i]);
    }
  }
  cout << sum;
  return 0;
}
