#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b;
  for (int i = 0; i < a; i++)
    for (int n = 0; n < b; n++) cin >> c;
  if (b == 3)
    cout << 4;
  else if (b == 5)
    cout << 10;
  else
    cout << 15;
  return 0;
}
