#include <bits/stdc++.h>
using namespace std;
const int N = 200000 + 100;
long long one[N], zero[N];
int main() {
  string a, b;
  cin >> a >> b;
  int cone = 0, czero = 0;
  for (int i = 0; i < b.size(); i++) {
    one[i] = '1' - b[i];
    zero[i] = b[i] - '0';
  }
  for (int i = 1; i < b.size(); i++) {
    one[i] += one[i - 1];
    zero[i] += zero[i - 1];
  }
  long long ans = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == '0') {
      ans += (zero[b.size() - a.size() + i] - (i == 0 ? 0 : zero[i - 1]));
    } else {
      ans += (one[b.size() - a.size() + i] - (i == 0 ? 0 : one[i - 1]));
    }
  }
  cout << ans << endl;
}
