#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int edge[m][2], cnt[7], i = 0, j = 0, domino[6];
  long long int mmm = m;
  for (i = 0; i < 7; i++) {
    cnt[i] = 0;
  }
  for (i = 0; i < 6; i++) {
    domino[i] = 6;
  }
  multimap<long long int, long long int> edg;
  multimap<long long int, long long int>::iterator itr;
  for (i = 0; i < m; i++) {
    for (j = 0; j < 2; j++) {
      cin >> edge[i][j];
      cnt[edge[i][j] - 1]++;
    }
    edg.insert(make_pair(edge[i][0], edge[i][1]));
    edg.insert(make_pair(edge[i][1], edge[i][0]));
  }
  if (n <= 6) {
    cout << m;
  } else {
    long long int common = 100000000000;
    for (i = 1; i <= 7; i++) {
      for (j = i + 1; j <= 7; j++) {
        long long int temp = 0;
        auto it = edg.equal_range(i);
        auto tempitr = edg.equal_range(j);
        for (auto ir = it.first; ir != it.second; ir++) {
          for (auto tempir = tempitr.first; tempir != tempitr.second;
               tempir++) {
            if (tempir->second == ir->second) {
              temp++;
              break;
            }
          }
        }
        common = min(common, temp);
      }
    }
    cout << m - common;
  }
}
