#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  long long r = 0;
  cin >> a >> b;
  auto n = b.length();
  auto arr = new pair<int, int>[n] {};
  arr[0] = (b[0] == '0' ? pair<int, int>{1, 0} : pair<int, int>{0, 1});
  for (size_t i = 1; i < n; i++) {
    arr[i] = arr[i - 1];
    if (b[i] == '0')
      arr[i].first++;
    else
      arr[i].second++;
  }
  for (size_t i = 0; i < a.length(); i++) {
    pair<int, int> t;
    if (i) t.first -= arr[i - 1].first, t.second -= arr[i - 1].second;
    auto j = b.length() - a.length() + i;
    t.first += arr[j].first, t.second += arr[j].second;
    r += (a[i] == '0' ? t.second : t.first);
  }
  cout << r;
  return 0;
}
