#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 20;
int n, m, dp[N];
char a[N], b[N];
long long ans;
int main() {
  scanf(" %s %s", a + 1, b + 1);
  n = strlen(a + 1), m = strlen(b + 1);
  for (int i = 1; i <= m; i++) dp[i] = dp[i - 1] + (b[i] - '0');
  for (int i = 1; i <= n; i++) {
    if (a[i] == '0') {
      ans += dp[m - n + i] - dp[i - 1];
    } else {
      ans += (m - n + i - i + 1) - (dp[m - n + i] - dp[i - 1]);
    }
  }
  printf("%lld", ans);
}
