#include <bits/stdc++.h>
using namespace std;
long long ar[1000000], ars[1000000];
int main() {
  long long sum = 0;
  string a, b;
  cin >> a >> b;
  for (int i = 0; i < b.length(); i++) {
    if (b[i] == '1')
      ar[i + 1] = 1 + ar[i], ars[i + 1] = ars[i];
    else
      ars[i + 1] = 1 + ars[i], ar[i + 1] = ar[i];
  }
  for (int i = 0; i < a.length(); i++) {
    if (a[i] == '0') {
      sum += (ar[b.length() - a.length() + i + 1] - ar[i]);
    } else {
      sum += (ars[b.length() - a.length() + i + 1] - ars[i]);
    }
  }
  cout << sum;
  return 0;
}
