#include <bits/stdc++.h>
using namespace std;
char s[3000];
char s1[3000];
char s2[3000];
int ans;
int len2;
struct node {
  int ch[26];
} tree[2001001];
int top = 0;
int newnode() {
  for (int i = 0; i < 26; i++) tree[top].ch[i] = -1;
  return top++;
}
void add(char* s, int len) {
  int now = 0;
  for (int i = 0; i < len; i++) {
    int next = s[i] - 'a';
    if (tree[now].ch[next] == -1) tree[now].ch[next] = newnode();
    now = tree[now].ch[next];
  }
}
int find(char* s, int& len, int now) {
  for (int i = 0; i < len; i++) {
    int next = s[i] - 'a';
    if (tree[now].ch[next] == -1) return -1;
    now = tree[now].ch[next];
  }
  return now;
}
void dfs(int& x) {
  if (find(s2, len2, x) >= 0) ans++;
  for (int i = 0; i < 26; i++)
    if (tree[x].ch[i] >= 0) dfs(tree[x].ch[i]);
}
int main() {
  while (scanf("%s%s%s", s, s1, s2) != EOF) {
    top = 0;
    newnode();
    int len = strlen(s);
    for (int i = 0; i < len; i++) add(s + i, len - i);
    int len1 = strlen(s1);
    len2 = strlen(s2);
    ans = 0;
    for (int i = max(0, len1 - len2); i < len1; i++) {
      bool f = false;
      for (int j = 0; j + i < len1; j++)
        if (s1[j + i] != s2[j]) {
          f = true;
          break;
        }
      if (!f) {
        if (find(s2, len2, find(s1, i, 0)) >= 0) ans++;
      }
    }
    int g = find(s1, len1, 0);
    if (g < 0) {
      printf("0\n");
      continue;
    }
    dfs(g);
    printf("%d\n", ans);
  }
}
