#include <bits/stdc++.h>
using namespace std;
vector<string> v;
void swap(char* s, int a, int b) {
  char t = s[a];
  s[a] = s[b];
  s[b] = t;
}
void perm(string s, int l, int r) {
  if (l == r) v.push_back(s);
  for (int i = l; i <= r; i++) {
    swap(&s[0], l, i);
    perm(s, l + 1, r);
    swap(&s[0], l, i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, m;
  cin >> n >> m;
  string s = "";
  if (n < 7) {
    for (int i = 1; i <= n; i++) s += to_string(i);
  } else {
    for (int i = 0; i < 7; i++) s += to_string(i);
  }
  perm(s, 0, n - 1);
  vector<pair<int, int> > v1;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v1.push_back(make_pair(x - 1, y - 1));
  }
  int M = 0;
  for (int i = 0; i < v.size(); i++) {
    int a[n], zv = -1;
    for (int j = 0; j < v[i].length(); j++) {
      a[j] = v[i][j] - 48;
      if (a[j] == 0) zv = j;
    }
    map<pair<int, int>, int> m1;
    int temp = 0;
    vector<pair<int, int> > v2;
    for (int j = 0; j < v1.size(); j++) {
      int x = a[v1[j].first], y = a[v1[j].second];
      if (x == 0 or y == 0) {
        v2.push_back(v1[j]);
        continue;
      }
      if (m1.find(make_pair(x, y)) == m1.end()) {
        temp += 1;
        m1[make_pair(x, y)] = 1;
        m1[make_pair(y, x)] = 1;
      }
    }
    int M1 = 0;
    if (v2.size() > 0) {
      map<pair<int, int>, int> m2 = m1;
      for (int j = 1; j < 7; j++) {
        a[zv] = j;
        int temp1 = 0;
        for (int k = 0; k < v2.size(); k++) {
          int x = a[v2[k].first], y = a[v2[k].second];
          if (m2.find(make_pair(x, y)) == m2.end()) {
            temp1 += 1;
            m2[make_pair(x, y)] = 1;
            m2[make_pair(y, x)] = 1;
          }
        }
        M1 = max(M1, temp1);
      }
    }
    temp += M1;
    M = max(temp, M);
  }
  cout << M << endl;
}
