#include <bits/stdc++.h>
using namespace std;
char s[2005], a[2005], b[2005];
unsigned long long seed = 1117;
unsigned long long h[2005], hs[2005];
vector<int> ve1;
vector<unsigned long long> ve2;
int main() {
  scanf("%s%s%s", s, a, b);
  int ls = strlen(s), la = strlen(a), lb = strlen(b);
  unsigned long long ha = 0, hb = 0;
  for (int i = la - 1; i >= 0; i--) ha = ha * seed + a[i];
  for (int i = lb - 1; i >= 0; i--) hb = hb * seed + b[i];
  h[0] = 1;
  for (int i = 1; i < ls; i++) h[i] = h[i - 1] * seed;
  hs[ls] = 0;
  for (int i = ls - 1; i >= 0; i--) hs[i] = hs[i + 1] * seed + s[i];
  for (int i = 0; i <= ls - lb; i++) {
    unsigned long long hsn = hs[i] - hs[i + lb] * h[lb];
    if (hsn == hb) ve1.push_back(i);
  }
  for (int i = 0; i <= ls - la; i++) {
    unsigned long long hsn = hs[i] - hs[i + la] * h[la];
    if (hsn == ha) {
      for (int j = 0; j < ve1.size(); j++) {
        if (ve1[j] < i || ve1[j] + lb < i + la) continue;
        unsigned long long hsno = hs[i] - hs[ve1[j] + lb] * h[ve1[j] + lb - i];
        ve2.push_back(hsno);
      }
    }
  }
  sort(ve2.begin(), ve2.end());
  long long ans = 0;
  if (ve2.size() > 0) ans++;
  for (int i = 1; i < ve2.size(); i++) {
    if (ve2[i] != ve2[i - 1]) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
