#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
typedef pair<ll, l_l> lll;
template<class Z> Z rng(Z a, Z b) {
  static mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
  return uniform_int_distribution<Z>(a, b - 1)(mt);
}

struct RollingHash {
  static constexpr uint64_t P0 = 4e9 + 7;
  static constexpr uint64_t P1 = 4e9 + 9;
  static constexpr uint64_t P2 = 998244353;
  static uint64_t B0;
  static uint64_t B1;
  static uint64_t B2;
  static vector<uint64_t> powB0;
  static vector<uint64_t> powB1;
  static vector<uint64_t> powB2;
  const int n;
  vector<uint64_t> h0;
  vector<uint64_t> h1;
  vector<uint64_t> h2;
  template<class Itr> RollingHash(Itr first, Itr last) : n(distance(first, last)), h0(n + 1), h1(n + 1),  h2(n+1) {
    for (int i = 0; i < n; ++i, ++first) {
      h0[i + 1] = (h0[i] * B0 + *first) % P0;
      h1[i + 1] = (h1[i] * B1 + *first) % P1;
      h2[i + 1] = (h2[i] * B2 + *first) % P2;
    }
    while (powB0.size() <= n) {
      powB0.push_back(powB0.back() * B0 % P0);
      powB1.push_back(powB1.back() * B1 % P1);
      powB2.push_back(powB2.back() * B2 % P2);
    }
  }
  uint64_t get0(int l, int r) { return (h0[r] + (P0 - h0[l]) * powB0[r - l]) % P0; }
  uint64_t get1(int l, int r) { return (h1[r] + (P1 - h1[l]) * powB1[r - l]) % P1; }
  uint64_t get2(int l, int r) { return (h2[r] + (P2 - h2[l]) * powB2[r - l]) % P2; }
  lll get(int l, int r) { return {get0(l, r), {get1(l, r), get2(l, r)}}; }
  bool eq(int l0, int r0, int l1, int r1) {
    return get0(l0, r0) == get0(l1, r1) and get1(l0, r0) == get1(l1, r1) and get2(l1, r1) == get2(l0, r0);
  }
  template<class Itr> static uint64_t get0(Itr first, Itr last) {
    uint64_t res = 0;
    while (first != last) {
      res = (res * B0 + *first++) % P0;
    }
    return res;
  }
  template<class Itr> static uint64_t get1(Itr first, Itr last) {
    uint64_t res = 0;
    while (first != last) {
      res = (res * B1 + *first++) % P1;
    }
    return res;
  }
};
uint64_t RollingHash::B0 = rng<unsigned>(1, RollingHash::P0);
uint64_t RollingHash::B1 = rng<unsigned>(1, RollingHash::P1);
uint64_t RollingHash::B2 = rng<unsigned>(1, RollingHash::P2);
vector<uint64_t> RollingHash::powB0{1};
vector<uint64_t> RollingHash::powB1{1};
vector<uint64_t> RollingHash::powB2{1};


int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S, T;
    cin >> S >> T;
    RollingHash RHSS(S.begin(), S.end());
    RollingHash RHST(T.begin(), T.end());
    map<lll, ll> mp;
    int N = T.size();
    for(int i = 0; i + N <= S.size(); i++) {
        auto tmp = RHSS.get(i, i + N);
        mp[tmp]++;
    }
    ll ans = - N * mp[RHST.get(0, N)];
    //cerr << ans << endl;
    for(int i = 0; i < N; i++) {
        for(char a = 'a'; a <= 'z'; a++) {
            auto tmp = RHST.get0(0, i);
            tmp *= RHST.B0;
            tmp += a;
            tmp %= RHST.P0;
            tmp *= RHST.powB0[N - 1 - i];
            tmp += RHST.get0(i + 1, N);
            tmp %= RHST.P0;
            auto tmp2 = RHST.get1(0, i);
            tmp2 *= RHST.B1;
            tmp2 += a;
            tmp2 %= RHST.P1;
            tmp2 *= RHST.powB1[N - 1 - i];
            tmp2 += RHST.get1(i + 1, N);
            tmp2 %= RHST.P1;
            auto tmp3 = RHST.get2(0, i);
            tmp3 *= RHST.B2;
            tmp3 += a;
            tmp3 %= RHST.P2;
            tmp3 *= RHST.powB2[N - 1 - i];
            tmp3 += RHST.get2(i + 1, N);
            tmp3 %= RHST.P2;
            lll tmp4 = {tmp, {tmp2, tmp3}};
            if(mp.count(tmp4)) ans += mp[tmp4];
        }
        for(char a = 'A'; a <= 'Z'; a++) {
            auto tmp = RHST.get0(0, i);
            tmp *= RHST.B0;
            tmp += a;
            tmp %= RHST.P0;
            tmp *= RHST.powB0[N - 1 - i];
            tmp += RHST.get0(i + 1, N);
            tmp %= RHST.P0;
            auto tmp2 = RHST.get1(0, i);
            tmp2 *= RHST.B1;
            tmp2 += a;
            tmp2 %= RHST.P1;
            tmp2 *= RHST.powB1[N - 1 - i];
            tmp2 += RHST.get1(i + 1, N);
            tmp2 %= RHST.P1;
            auto tmp3 = RHST.get2(0, i);
            tmp3 *= RHST.B2;
            tmp3 += a;
            tmp3 %= RHST.P2;
            tmp3 *= RHST.powB2[N - 1 - i];
            tmp3 += RHST.get2(i + 1, N);
            tmp3 %= RHST.P2;
            lll tmp4 = {tmp, {tmp2, tmp3}};
            if(mp.count(tmp4)) ans += mp[tmp4];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 40116