#include <bits/stdc++.h>

using namespace std;

  

int factorial(int n)

{

  

    int fact = 1;

    for (int i = 2; i <= n; i++)

        fact = fact * i;

  

    return fact;

}

  

int ncr(int n, int r)

{

    return factorial(n) / (factorial(r) * factorial(n - r));

}

  

int countWays(string str)

{

    int freq[26] = { 0 };

    int nvowels = 0, nconsonants = 0;

  

    int vplaces, cways, vways;

  

    

    

    for (int i = 0; i < str.length(); i++)

        ++freq[str[i] - 'a'];

  

    

    

    for (int i = 0; i < 26; i++) {

  

        if (i == 0 || i == 4 || i == 8

            || i == 14 || i == 20)

            nvowels += freq[i];

        else

            nconsonants += freq[i];

    }

    

    vplaces = nconsonants + 1;

  

    

    cways = factorial(nconsonants);

    for (int i = 0; i < 26; i++) {

        if (i != 0 && i != 4 && i != 8 && i != 14

            && i != 20 && freq[i] > 1) {

  

            cways = cways / factorial(freq[i]);

        }

    }

  

    

    vways = ncr(vplaces, nvowels) * factorial(nvowels);

    for (int i = 0; i < 26; i++) {

        if (i == 0 || i == 4 || i == 8 || i == 14

            || i == 20 && freq[i] > 1) {

            vways = vways / factorial(freq[i]);

        }

    }

  

    return cways * vways;

}

  

int main()

{

    string str = "permutation";

  

    cout << countWays(str) << endl;

  

    return 0;

}