#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  long long ans = 0;
  long long x = 0;
  long long dist = b.size() - a.size() + 1;
  for (int i = 0; i < dist; i++) {
    x += (b[i] - '0');
  }
  for (int i = 0; i < a.size(); i++) {
    ans += a[i] == '0' ? x : dist - x;
    x += (b[dist + i] - b[i]);
  }
  cout << ans;
}
