#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2002;
int N, uz1, uz2;
bool beg[MAXN];
char ar[MAXN], s1[MAXN], s2[MAXN];
set<long long> res;
int main() {
  scanf(" %s %s %s", ar, s1, s2);
  N = strlen(ar);
  uz1 = strlen(s1);
  uz2 = strlen(s2);
  for (int i = 0; i <= N - uz1; i++) {
    int fl = 1;
    for (int j = 0; j < uz1; j++)
      if (ar[i + j] != s1[j]) {
        fl = 0;
        break;
      }
    if (fl) beg[i] = true;
  }
  for (int i = 0; i <= N - uz2; i++) {
    int fl = 1;
    for (int j = 0; j < uz2; j++)
      if (ar[i + j] != s2[j]) {
        fl = 0;
        break;
      }
    if (fl) {
      long long tmp = 0;
      for (int j = i + uz2 - 1; j >= 0; j--) {
        tmp = tmp * 109LL + ar[j];
        if (beg[j] && j <= i && j + uz1 <= i + uz2) res.insert(tmp);
      }
    }
  }
  printf("%d\n", res.size());
  return 0;
}
