#include <bits/stdc++.h>
using namespace std;
template <typename T>
std::string printVector(const std::vector<T> &data) {
  std::stringstream ss;
  std::ostream_iterator<T> out_it(ss, ", ");
  ss << "[";
  std::copy(data.begin(), data.end() - 1, out_it);
  ss << data.back() << "]";
  return ss.str();
}
template <typename T>
void print_array(const T &ary, int size) {
  for (int i = (0); i < (size); ++i) {
    cout << ary[i] << " ";
  }
  cout << endl;
}
const int MOD = 1e9 + 7;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);
signed main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(12);
  int N, M;
  cin >> N >> M;
  set<pair<int, int> > s;
  for (int i = (0); i < (M); ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    if (a > b) swap(a, b);
    s.insert(pair<int, int>(a, b));
  }
  if (N <= 6) {
    cout << M << endl;
    return 0;
  }
  int ans = 0;
  for (int i = (0); i < (7); ++i)
    for (int j = (i + 1); j < (7); ++j) {
      set<pair<int, int> > ex;
      for (auto p : s) {
        int a, b;
        tie(a, b) = p;
        if (a == j) {
          if (ex.count(pair<int, int>(i, b)) != 1) {
            ex.insert(pair<int, int>(i, b));
          }
        } else if (b == j) {
          if (a > i) {
            if (ex.count(pair<int, int>(i, a)) != 1) {
              ex.insert(pair<int, int>(i, a));
            }
          } else {
            if (ex.count(pair<int, int>(a, i)) != 1) {
              ex.insert(pair<int, int>(a, i));
            }
          }
        } else {
          if (ex.count(pair<int, int>(a, b)) != 1) {
            ex.insert(pair<int, int>(a, b));
          }
        }
      }
      int tmp = 0;
      for (auto p : ex) {
        tmp++;
        ;
        ;
      };
      ans = max(ans, tmp);
    }
  cout << ans << endl;
}
