func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MOD = 1e9 + 9;   int n, p, q;   string s, t, a, b;   int c[2005], d[2005], h[2005], invH[2005], k[2005], invK[2005];   vector<pair<int, int>> memo;   int mul(int aa, int bb) { return ((long long)aa * bb) % MOD; }   int add(int aa, int bb) { return (aa + bb) % MOD; }   int sub(int aa, int bb) { return (aa - bb + MOD) % MOD; }   int modpow(int num, int pi) {     int res = 1;     while (pi > 0) {       if (pi & 1) res = mul(res, num);       num = mul(num, num);       pi >>= 1;     }     return res;   }   pair<int, int> getHash(int lo, int hi) {     return make_pair(mul(sub(c[hi], c[lo]), invH[lo]),                      mul(sub(d[hi], d[lo]), invK[lo]));   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> s >> a >> b;     n = s.size();     p = a.size();     q = b.size();     h[0] = invH[0] = 1;     k[0] = invK[0] = 1;     for (int i = 1; i <= n; i++) {       h[i] = mul(h[i - 1], 31);       invH[i] = modpow(h[i], MOD - 2);       k[i] = mul(k[i - 1], 53);       invK[i] = modpow(k[i], MOD - 2);     }     for (int i = 0; i < n; i++) {       c[i + 1] = add(c[i], mul(h[i], s[i]));       d[i + 1] = add(d[i], mul(k[i], s[i]));     }     pair<int, int> x = make_pair(0, 0);     for (int i = 0; i < p; i++) {       x.first = add(x.first, mul(h[i], a[i]));       x.second = add(x.second, mul(k[i], a[i]));     }     pair<int, int> y = make_pair(0, 0);     for (int i = 0; i < q; i++) {       y.first = add(y.first, mul(h[i], b[i]));       y.second = add(y.second, mul(k[i], b[i]));     }     for (int i = 0; i < n - p + 1; i++) {       for (int j = i + max(0, p - q); j < n - q + 1; j++) {         if (x == getHash(i, i + p) && y == getHash(j, j + q)) {           memo.push_back(getHash(i, j + q));         }       }     }     sort(memo.begin(), memo.end());     int ans = unique(memo.begin(), memo.end()) - memo.begin();     cout << ans <<   n ;     return 0;   }   