#include <bits/stdc++.h>
using namespace std;
bool edge[8][8];
bool domino[7][7];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int ans = 0, n, m;
  cin >> n >> m;
  for (int i = 1, x, y; i <= m; i++) {
    cin >> x >> y;
    edge[x][y] = edge[y][x] = true;
  }
  int i[8];
  for (i[1] = 1; i[1] <= 7; i[1]++)
    for (i[2] = 1; i[2] <= 7; i[2]++)
      for (i[3] = 1; i[3] <= 7; i[3]++)
        for (i[4] = 1; i[4] <= 7; i[4]++)
          for (i[5] = 1; i[5] <= 7; i[5]++)
            for (i[6] = 1; i[6] <= 7; i[6]++)
              for (i[7] = 1; i[7] <= 7; i[7]++) {
                memset(domino, 0, sizeof domino);
                for (int j = 1; j <= 7; j++)
                  for (int k = 1; k <= 7; k++)
                    if (edge[j][k]) {
                      if (i[j] < i[k])
                        domino[i[j]][i[k]] = true;
                      else
                        domino[i[k]][i[j]] = true;
                    }
                int cnt = 0;
                for (int j = 1; j <= 6; j++)
                  for (int k = j; k <= 6; k++) cnt += domino[j][k];
                ans = max(ans, cnt);
              }
  cout << ans << endl;
}
