#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string a, b;
  cin >> a >> b;
  int l = a.length(), l2 = b.length();
  long long int ans = 0;
  long long int pre[200001][2];
  for (int i = 0; i < l2; i++) {
    if (b[i] == '0') {
      pre[i + 1][0] = pre[i][0] + 1;
      pre[i + 1][1] = pre[i][1];
    }
    if (b[i] == '1') {
      pre[i + 1][1] = pre[i][1] + 1;
      pre[i + 1][0] = pre[i][0];
    }
  }
  for (int c = 0; c < a.length(); c++) {
    for (int k = 0; k < 2; k++) {
      long long int val = a[c] - '0';
      long long int part = abs(val - k);
      ans = ans + part * (pre[c + l2 - l + 1][k] - pre[c][k]);
    }
  }
  cout << ans;
}
