#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string a, b;
  cin >> a >> b;
  int len = a.length();
  int lenb = b.length();
  int *numb = new int[lenb];
  int *numb0 = new int[lenb];
  long long num1 = 0, num0 = 0;
  for (int i = 0; i < lenb; ++i) {
    if (b[i] == '1') {
      ++num1;
    } else {
      ++num0;
    }
    numb[i] = num1;
    numb0[i] = num0;
  }
  long long hd = 0;
  for (int i = 0; i < len; ++i) {
    if (a[i] == '0') {
      if (i > 0)
        hd += numb[lenb - 1 - (len - 1 - i)] - numb[i - 1];
      else
        hd += numb[lenb - 1 - (len - 1)];
    } else {
      if (i > 0)
        hd += numb0[lenb - 1 - (len - 1 - i)] - numb0[i - 1];
      else
        hd += numb0[lenb - 1 - (len - 1)];
    }
  }
  cout << hd << "\n";
  delete[] numb0;
  delete[] numb;
  return 0;
}
