#include <iostream>
#include <limits.h>
using namespace std;

int main()
{
    for (int i = 6; i < INT_MAX; i++)
    {
        if ((i - 1) % 5 != 0)
            continue;
        int m = i;
        m -= 1; //吃掉一个
        m = m / 5 * 4;
        if (m <= 0 || (m - 2) % 5 != 0)
            continue;
        m -= 2;
        m = m / 5 * 4;
        if (m <= 0 || (m - 3) % 5 != 0)
            continue;
        m -= 3;
        m = m / 5 * 4;
        if (m <= 0 || (m - 4) % 5 != 0)
            continue;
        m -= 4;
        m = m / 5 * 4;
        if (m <= 0 || m % 5 != 0)
            continue;
        cout << i << endl;
        break;
    }
    return 0;
}
