#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int INF = 1e9+7;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)
#define rtr(c, i) for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define repab(i,a,b) for(auto i=a;i<(b);i++)
#define rep(i,b) for(auto i=0;i<(b);i++)
#define pb push_back
#define sz(c) int((c).size())

enum {
  FOUR_CARD,
  FULL_HOURSE,
  STRAIGHT,
  THREE_CARD,
  TWO_PAIR,
  ONE_PAIR,
  NULL_HAND,
} hands;

int check(map<int, int> m)
{
  int maxnr = 0;
  int minnr = INF;
  int maxv = 0;
  int minv = INF;
  int maxnr_count = 0;
  tr (m, i) {
    if (maxnr < i->second) {
      maxnr_count=1;
      maxnr = i->second;
    } else if (maxnr == i->second) {
      maxnr_count++;
    }
    minnr = min(minnr, i->second);
    maxv = max(maxv, i->first);
    minv = min(minv, i->first);
  }
  if (maxnr == 4)
    return FOUR_CARD;
  if (maxnr == 3 && minnr == 2)
    return FULL_HOURSE;
  if (minnr == 1 && maxnr == 1) {
    if ((maxv - minv == 4) || (m[10] && m[11] && m[12] && m[13] && m[1]))
      return STRAIGHT;
  }
  if (maxnr == 3)
    return THREE_CARD;
  if (maxnr == 2) {
    if (maxnr_count == 2)
      return TWO_PAIR;
    else
      return ONE_PAIR;
  }

  return NULL_HAND;
}
void phand(map<int, int> m)
{
  vector<string> hand_name = {
    "four card",
    "full house",
    "straight",
    "three card",
    "two pair",
    "one pair",
    "null",
  };
  cout << hand_name[check(m)] << endl;
}

int main(int argc, char **argv)
{
  vi v;
  map<int, int> m;
  char c;
  int x, minval;

  for (;;) {
    v.clear();
    m.clear();
    rep (i, 4) {
      cin >> x;
      cin >> c;
      v.pb(x);
    }
    cin >> x;
    v.pb(x);
    if (cin.eof())
      break;

    rep (i, 5) {
      m[v[i]]++;
    }
    phand(m);
  }
  return 0;
}
#include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <numeric>
#include <string>
#include <cstring>
#include <cmath>
using namespace std;

#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
	#define eprintf(...) 42
#endif

typedef long long int int64;


const int N = (int) 1e5 + 100;

vector <int> ch[N];
int k;

struct Ans
{
    vector <int> v;

    Ans() : v({0}) {}

    void eprint()
    {
        for (int i = 0; i < min(k + 1, (int) v.size()); i++)
            eprintf("[%d] %d, ", i, v[(int) v.size() - 1 - i]);
        eprintf("\n");
    }
};


Ans dp[N];


int merge(int a, int b)
{
    if ((int) dp[a].v.size() < (int) dp[b].v.size())
        swap(a, b);

    for (int i = 0; i < (int) dp[b].v.size(); i++)
        dp[a].v[(int) dp[a].v.size() - 1 - i] += dp[b].v[(int) dp[b].v.size() - 1 - i];

    return a;
}

int goUp(int a)
{
    dp[a].v.push_back(1);
    if ((int) dp[a].v.size() >= k + 1)
        dp[a].v.back() += dp[a].v[(int) dp[a].v.size() - k - 1];

    int i = 2;
    while (i <= (int) dp[a].v.size() && dp[a].v[(int) dp[a].v.size() - i] > dp[a].v.back())
    {
        dp[a].v[(int) dp[a].v.size() - i] = dp[a].v.back();
        i++;
    }

    return a;
}

int solve(int v)
{
    int cur = v;
    for (int to : ch[v])
    {
        int nx = solve(to);
        cur = merge(cur, nx);
    }
    //eprintf("(%d): ", v); dp[cur].eprint();
    if (v != 0)
        cur = goUp(cur);
    //eprintf("(%d'): ", v); dp[cur].eprint();
    return cur;
}

int a[N];

int main(int,  char **)
{
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#endif

    int n;
    scanf("%d%d", &n, &k);

    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
        a[i]--;
    }

    for (int i = 1; i < n; i++)
        ch[a[i]].push_back(i);

    int id = solve(0);

    int ans = dp[id].v[max(0, (int) dp[id].v.size() - k - 1)];

    if (a[0] != 0)
        ans++;

    printf("%d\n", ans);

	return 0;
}


