#include <bits/stdc++.h>
using namespace std;
const long long p1 = 239, mod1 = 1000003013;
long long steps1[2001], h1[2001];
void culchash(const string &s) {
  h1[0] = 0;
  steps1[0] = 1;
  for (int i = 0; i < s.size(); i++) {
    h1[i + 1] = ((h1[i] * p1) % mod1 + s[i]) % mod1;
    steps1[i + 1] = (steps1[i] * p1) % mod1;
  }
}
inline long long gethash(const string &s) {
  long long ha1 = s[0], ha2 = s[0];
  for (int i = 1; i < s.size(); i++) {
    ha1 = ((ha1 * p1) % mod1 + s[i]) % mod1;
  }
  return ha1;
}
inline long long getsubhash(int l, int r) {
  long long ha1 =
      (h1[r] - ((h1[l - 1] * steps1[r - l + 1]) % mod1) + mod1) % mod1;
  return ha1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string t, s1, s2;
  cin >> t >> s1 >> s2;
  if (s1.size() > t.size() || s2.size() > t.size()) {
    cout << 0;
    return 0;
  }
  culchash(t);
  long long h1 = gethash(s1), h2 = gethash(s2);
  unordered_set<long long> se[2001];
  for (int i = 0; i + s1.size() <= t.size(); i++) {
    if (getsubhash(i + 1, i + s1.size()) != h1) continue;
    for (int j = max(i, int(i + s1.size() - s2.size()));
         j + s2.size() <= t.size(); j++) {
      if (getsubhash(j + 1, j + s2.size()) == h2) {
        se[j + s2.size() - i].insert(getsubhash(i + 1, j + s2.size()));
      }
    }
  }
  long long sum = 0;
  for (int i = 0; i < 2001; i++) sum += se[i].size();
  cout << sum;
}
