#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int INF = 1e9;
const int N = 2e5 + 5;
const ll MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string a, b;
  cin >> a >> b;
  vector<int> cum;
  int n = a.size(), m = b.size();
  int sum = 0, i;
  for (i = 0; i <= m - n; i++) {
    if (b[i] == '1') sum++;
  }
  cum.push_back(sum);
  int k = 0;
  for (; i < m; i++) {
    if (b[k] == '1') sum--;
    if (b[i] == '1') sum++;
    cum.push_back(sum);
    ++k;
  }
  ll ans = 0;
  k = 0;
  for (int i = 0; i < n; i++) {
    int ex = 0;
    if (a[i] == '1') ex = m - n + 1;
    ans += (ll)abs(cum[k] - ex), k++;
  }
  cout << ans;
  return 0;
}
