#include <bits/stdc++.h>
using namespace std;
void run() {
  string s1, s2;
  cin >> s1 >> s2;
  vector<long long> fa1;
  vector<long long> fa2;
  fa1.push_back(1 - (s2[0] - '0'));
  for (int i = (int)1; i < (int)s2.size(); i++) {
    fa1.push_back(fa1[i - 1] + (1 - (s2[i] - '0')));
  }
  fa2.push_back(s2[0] - '0');
  for (int i = (int)1; i < (int)s2.size(); i++) {
    fa2.push_back(fa2[i - 1] + s2[i] - '0');
  }
  long long sum = 0;
  for (int i = (int)0; i < (int)s1.size(); i++) {
    long long b = i;
    long long e = s2.size() - s1.size() + i;
    if (s1[i] == '1') {
      long long val = fa1[e];
      if (b > 0) val -= fa1[b - 1];
      sum += val;
    } else {
      long long val = fa2[e];
      if (b > 0) val -= fa2[b - 1];
      sum += val;
    }
  }
  printf("%lld\n", sum);
}
int main() { run(); }
