#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9 + 7;
struct BipartiteMatching {
  int n, timestamp;
  vector<vector<int>> g;
  vector<int> alive, used, match;
  BipartiteMatching(int n)
      : n(n), timestamp(0), g(n), alive(n, 1), used(n, 0), match(n, -1) {}
  void add_edge(int u, int v) {
    g[u].emplace_back(v);
    g[v].emplace_back(u);
  }
  bool dfs(int idx) {
    used[idx] = timestamp;
    for (int to : g[idx])
      if (alive[to]) {
        int to_match = match[to];
        if (to_match == -1 || (used[to_match] != timestamp && dfs(to_match))) {
          match[idx] = to;
          match[to] = idx;
          return true;
        }
      }
    return false;
  }
  int bipartite_matching() {
    int ret = 0;
    for (int i = 0; i < n; i++)
      if (alive[i]) {
        if (match[i] == -1) ++timestamp, ret += dfs(i);
      }
    return ret;
  }
  friend ostream& operator<<(ostream& os, BipartiteMatching& bm) {
    for (int i = 0; i < bm.n; i++)
      if (i < bm.match[i]) {
        os << i << " - " << bm.match[i] << endl;
      }
    return os;
  }
};
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m), b(m);
  for (int i = 0; i < m; i++) cin >> a[i] >> b[i], a[i]--, b[i]--;
  auto solve = [&](int c) {
    BipartiteMatching bm(n * 2);
    int need = 2 * (n - 1) + 1 + n - 1;
    int used = 0;
    for (int i = 0; i < m; i++) {
      if (a[i] == c || b[i] == c) {
        need--;
      } else {
        used++;
        bm.add_edge(a[i], b[i] + n);
      }
    }
    int match = bm.bipartite_matching();
    return (need - match) + (used - match);
  };
  int mi = INF;
  for (int i = 0; i < n; i++) mi = min(mi, solve(i));
  cout << mi << endl;
  return 0;
}
