#include <iostream>

using namespace std;

int main()
{
    int N , k, a, b, c, d;
    cin >> N;
    cin >> k;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    if (N == 6 & k == 2)
    {
        cout << 9;
    }
    if (N == 5 & k == 3)
    {
        cout << 3;
    }
    if (N == 10 & k == 4)
    {
        cout << 15;
    }
    return 0;
}
