#include <bits/stdc++.h>
using namespace std;
long long zs[200005], os[200005];
int main() {
  if (!0) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
  }
  cout << fixed;
  cout << setprecision(12);
  int l1, l2, i, j;
  string a, b;
  cin >> a >> b;
  l1 = a.length();
  l2 = b.length();
  for (i = l2 - 1; i >= 0; i--) {
    zs[i] = zs[i + 1] + (b[i] == '0');
    os[i] = os[i + 1] + (b[i] == '1');
  }
  long long ans = 0;
  for (i = 0; i < l1; i++) {
    if (a[i] == '0')
      ans = ans + (os[i] - os[l2 - (l1 - i) + 1]);
    else
      ans = ans + (zs[i] - zs[l2 - (l1 - i) + 1]);
  }
  cout << ans << "\n";
}
