#include <bits/stdc++.h>
using namespace std;
void debug() { cout << endl; }
template <typename T, typename... Args>
void debug(T x, Args... args) {
  cout << x << " ";
  debug(args...);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string a, b;
  cin >> a >> b;
  int n = a.size();
  int m = b.size();
  vector<int> acum(m + 1, 0);
  for (int i = 1; i < m + 1; ++i) {
    acum[i] = acum[i - 1] + (b[i - 1] == '1');
  }
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    int ones = acum[m - n + 1 + i] - acum[i];
    if (a[i] == '0')
      ans += ones;
    else
      ans += m - n + 1 - ones;
  }
  cout << ans << "\n";
}
