#include <bits/stdc++.h>
using namespace std;
char C[2005];
char A[2005];
char B[2005];
bool a[2005];
bool b[2005];
struct Node {
  Node* H[28];
  bool is;
  Node() {
    is = 0;
    for (int i = 0; i < 28; i++) H[i] = NULL;
  }
} T;
int l = 0;
int main() {
  scanf("%s%s%s", C, A, B);
  int x = -1;
  while (1) {
    x = strstr(C + x + 1, A) - C;
    if (x >= 0 && x < strlen(C))
      a[x] = 1;
    else
      break;
  }
  x = -1;
  while (1) {
    x = strstr(C + x + 1, B) - C;
    if (x >= 0 && x < strlen(C))
      b[x + strlen(B) - 1] = 1;
    else
      break;
  }
  Node* p;
  int v;
  for (int i = 0; C[i]; i++)
    if (a[i]) {
      p = &T;
      for (int j = i; C[j]; j++) {
        v = C[j] - 'a';
        if (p->H[v] == NULL) {
          p->H[v] = new Node();
        }
        p = p->H[v];
        if (b[j] && !p->is && j - i + 1 >= max(strlen(A), strlen(B))) {
          l++;
          p->is = 1;
        }
      }
    }
  printf("%d\n", l);
  cin >> v;
  return 0;
}
