#include <bits/stdc++.h>
using namespace std;
long long nChooseR(int n, int k);
long long gcd(long long a, long long b);
vector<string> split(string target, char c);
bool isPrime(long long g);
long long n, m, t, a[] = {0, 0, 1, 2, 3, 4, 5}, k, x, y, z;
long long ans;
map<pair<int, int>, int> mp;
vector<vector<int>> grid(7);
void solve(int i) {
  for (auto u : grid[i]) {
    if (mp[make_pair(a[i], a[u])] == 1) {
      z++;
      mp[make_pair(a[i], a[u])] = 0;
      mp[make_pair(a[u], a[i])] = 0;
      solve(u);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++) {
    cin >> x >> y;
    x--;
    y--;
    grid[x].push_back(y);
    grid[y].push_back(x);
  }
  do {
    z = 0;
    for (int i = 0; i < (int)(6); i++) {
      for (int j = 0; j < (int)(6); j++) mp[make_pair(i, j)] = 1;
    }
    for (int i = 0; i < (int)(6); i++) solve(i);
    ans = max(ans, z);
  } while (next_permutation(a, a + 7));
  cout << ans;
  return 0;
}
long long nChooseR(int n, int k) {
  if (k > n) return 0;
  if (k * 2 > n) k = n - k;
  if (k == 0) return 1;
  long long result = n;
  for (int i = 2; i <= k; ++i) {
    result *= (n - i + 1);
    result /= i;
  }
  return result;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
vector<string> split(string target, char c) {
  string d = "";
  vector<string> arr;
  for (auto n : target) {
    if (n != c)
      d += n;
    else if (d != "")
      arr.push_back(d), d = "";
  }
  if (d != "") arr.push_back(d), d = "";
  return arr;
}
bool isPrime(long long g) {
  if ((g % 2 == 0 && g > 2) || g == 1) return 0;
  for (long long i = 3; i * i <= g; i += 2)
    if (g % i == 0) return 0;
  return 1;
}
