#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  ;
  string a, b;
  cin >> a >> b;
  long la = a.length();
  long lb = b.length();
  long prefix[lb + 1][2];
  prefix[0][0] = prefix[0][1] = 0;
  for (long i = 1; i <= lb; i++) {
    prefix[i][0] = prefix[i - 1][0];
    prefix[i][1] = prefix[i - 1][1];
    prefix[i][b[i - 1] - '0']++;
  }
  long long ans = 0;
  long temp;
  for (long i = 0; i < la; i++) {
    for (long c = 0; c <= 1; c++) {
      temp = abs(a[i] - c - '0');
      ans += temp * (prefix[lb - la + i + 1][c] - prefix[i][c]);
    }
  }
  cout << ans;
  return 0;
}
