#include <bits/stdc++.h>
using namespace std;
int x[100], y[100], a[100];
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << 0;
    return 0;
  }
  for (int i = 1; i <= m; i++) {
    cin >> x[i] >> y[i];
    x[i]--;
    y[i]--;
  }
  if (n <= 6) {
    cout << m;
    return 0;
  }
  a[0] = 1;
  a[1] = 1;
  a[2] = 2;
  a[3] = 3;
  a[4] = 4;
  a[5] = 5;
  a[6] = 6;
  int answer = 0;
  do {
    map<pair<int, int>, int> mp;
    for (int i = 1; i <= m; i++) {
      int k1 = a[x[i]], k2 = a[y[i]];
      if (k2 > k1) swap(k1, k2);
      mp[make_pair(k1, k2)] = 1;
    }
    answer = max(answer, (int)mp.size());
  } while (next_permutation(a, a + n));
  cout << answer;
}
