#include <bits/stdc++.h>
using namespace std;
char a[200104];
char b[200104];
int dp[200104][2];
int main() {
  cin >> a;
  cin >> b;
  int k1 = strlen(a);
  int k2 = strlen(b);
  if (b[0] == '0') {
    dp[0][0] = 1;
  } else
    dp[0][1] = 1;
  for (int i = 1; i < k2; i++) {
    if (b[i] == '0')
      dp[i][0] = dp[i - 1][0] + 1;
    else
      dp[i][0] = dp[i - 1][0];
  }
  for (int i = 1; i < k2; i++) {
    if (b[i] == '1')
      dp[i][1] = dp[i - 1][1] + 1;
    else
      dp[i][1] = dp[i - 1][1];
  }
  long long ans = 0;
  for (int i = 0; i < k1; i++) {
    if (a[i] == '0') {
      ans += dp[k2 - k1 + i][1] - dp[i - 1][1];
    } else {
      ans += dp[k2 - k1 + i][0] - dp[i - 1][0];
    }
  }
  cout << ans << endl;
  return 0;
}
