#include <bits/stdc++.h>
using namespace std;
class node {
 public:
  node* arr[26];
  node() {
    for (int f = 0; f < 26; f++) arr[f] = NULL;
  }
};
class trie {
  node* root;

 public:
  int size;
  trie() {
    size = 0;
    root = new node;
  }
  bool insert(string s, int counter, string b) {
    node* temp = root;
    int f = 0;
    while (f < s.size()) {
      if (temp->arr[s[f] - 'a']) {
        counter -= (b[s[f] - 'a'] != '1');
        if (counter < 0) return 0;
        temp = temp->arr[s[f] - 'a'];
        f++;
      } else {
        counter -= (b[s[f] - 'a'] != '1');
        if (counter < 0) return 0;
        temp->arr[s[f] - 'a'] = new node;
        temp = temp->arr[s[f] - 'a'];
        size++;
        f++;
      }
    }
    return 1;
  }
};
int main() {
  string s;
  string b;
  string c;
  vector<long long> m;
  cin >> s >> b >> c;
  long long p1 = 10007, p2 = 1e14 + 3, bi = 0, ci = 0;
  for (int f = 0; f < b.size(); f++) bi = (bi * p1 + b[f]) % p2;
  for (int f = 0; f < c.size(); f++) ci = (ci * p1 + c[f]) % p2;
  long long power = 1;
  for (int f = 1; f < c.size(); f++) power = (power * p1) % p2;
  for (int f = 0; f < s.size(); f++) {
    long long t = 0, t1 = 0, t2 = 0;
    for (int f1 = f; f1 < s.size(); f1++) {
      t = (t * p1 + s[f1]) % p2;
      if (f1 - f < b.size()) t1 = (t1 * p1 + s[f1]) % p2;
      if (f1 - f + 1 == b.size() && t1 != bi) break;
      if (f1 - f < c.size())
        t2 = (t2 * p1 + s[f1]) % p2;
      else {
        t2 = ((t2 - power * s[f1 - c.size()]) % p2 + p2) % p2;
        t2 = (t2 * p1 + s[f1]) % p2;
      }
      if (f1 - f + 1 >= b.size() && t1 == bi && f1 - f + 1 >= c.size() &&
          t2 == ci)
        m.push_back(t);
    }
  }
  sort(m.begin(), m.end());
  m.resize(unique(m.begin(), m.end()) - m.begin());
  cout << m.size() << endl;
  return 0;
}
