#include <bits/stdc++.h>
using namespace std;
long long MAX = 1000 * 1000 * 1000;
long long bfs(long long from, vector<vector<long long>> &g) {
  long long ans = 0;
  long long counter = 0;
  long long n = g.size();
  vector<bool> used(n);
  vector<long long> nums(n, 0);
  vector<vector<bool>> domino(6, vector<bool>(6, true));
  queue<long long> q;
  q.push(from);
  used[from] = true;
  nums[from] = counter;
  counter++;
  for (long long i = 0; i < n; i++) {
    while (!q.empty()) {
      long long f = q.front();
      q.pop();
      for (long long i = 0; i < g[f].size(); i++) {
        long long to = g[f][i];
        if (!used[to]) {
          if (counter != 6) {
            nums[to] = counter;
            counter++;
          } else {
            nums[to] = -1;
          }
          q.push(to);
          used[to] = true;
          if (nums[to] != -1 && nums[f] != -1)
            if (domino[nums[to]][nums[f]]) {
              ans++;
              domino[nums[to]][nums[f]] = false;
              domino[nums[f]][nums[to]] = false;
            }
        } else {
          if (nums[to] != -1 && nums[f] != -1)
            if (domino[nums[to]][nums[f]]) {
              ans++;
              domino[nums[to]][nums[f]] = false;
              domino[nums[f]][nums[to]] = false;
            }
        }
      }
    }
    if (!used[i]) {
      q.push(i);
      if (counter != 6) {
        nums[i] = counter;
        counter++;
      } else {
        nums[i] = -1;
      }
      used[i] = true;
    }
  }
  long long x = -1;
  for (long long i = 0; i < n; i++) {
    if (nums[i] == -1) {
      x = i;
      break;
    }
  }
  long long plu = 0;
  if (x != -1) {
    for (long long i = 0; i < 6; i++) {
      long long cur = 0;
      nums[x] = i;
      for (long long i = 0; i < g[x].size(); i++) {
        long long to = g[x][i];
        if (domino[nums[to]][nums[x]]) {
          cur++;
        }
      }
      plu = max(plu, cur);
    }
  }
  ans += plu;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> g(n);
  for (long long i = 0; i < m; i++) {
    long long from, to;
    cin >> from >> to;
    from--;
    to--;
    g[from].push_back(to);
    g[to].push_back(from);
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    ans = max(ans, bfs(i, g));
  }
  cout << ans;
  return 0;
}
