#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 3;
string s, p;
int F[MAX][2];
void solve() {
  cin >> s >> p;
  F[0][0] = F[0][1] = 0;
  for (int i = 1; i <= p.size(); ++i) {
    for (int j = 0; j < 2; ++j) {
      F[i][j] = F[i - 1][j];
    }
    ++F[i][p[i - 1] - '0'];
  }
  long long int ans = 0;
  for (int i = 0; i < s.size(); ++i) {
    int c = s[i] - '0';
    for (int j = 0; j < 2; ++j) {
      ans += abs(c - j) * (F[p.size() - s.size() + i + 1][j] - F[i][j]);
    }
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
