#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e16;
const long long N = 1e5 + 10;
vector<int> v[10];
int g[10][10];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  if (n <= 6) {
    cout << m;
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
    g[x][y] = g[y][x] = 1;
  }
  int ans = 0;
  for (int i = 1; i <= 7; i++) {
    vector<int> cnt(8, 0);
    for (auto k : v[i]) {
      for (int j = 0; j <= 7; j++) {
        if (g[k][j] == 0) cnt[j]++;
      }
    }
    int temp = 0;
    for (int j = 1; j <= 7; j++) {
      if (i != j) temp = max(temp, (cnt[j]));
    }
    ans = max(ans, m - int(v[i].size()) + min(temp, int(v[i].size())));
  }
  cout << ans;
  return 0;
}
