#include <bits/stdc++.h>
using namespace std;
bool dfs(int a, int L, vector<vector<int> >& g, vector<int>& btoa,
         vector<int>& A, vector<int>& B) {
  if (A[a] != L) return 0;
  A[a] = -1;
  for (auto& b : g[a])
    if (B[b] == L + 1) {
      B[b] = 0;
      if (btoa[b] == -1 || dfs(btoa[b], L + 1, g, btoa, A, B))
        return btoa[b] = a, 1;
    }
  return 0;
}
int hopcroftKarp(vector<vector<int> >& g, vector<int>& btoa) {
  int res = 0;
  vector<int> A(g.size()), B(btoa.size()), cur, next;
  for (;;) {
    fill(A.begin(), A.end(), 0);
    fill(B.begin(), B.end(), 0);
    cur.clear();
    for (auto& a : btoa)
      if (a != -1) A[a] = -1;
    for (int a = 0; a < ((int)(g).size()); ++a)
      if (A[a] == 0) cur.push_back(a);
    for (int lay = 1;; lay++) {
      bool islast = 0;
      next.clear();
      for (auto& a : cur)
        for (auto& b : g[a]) {
          if (btoa[b] == -1) {
            B[b] = lay;
            islast = 1;
          } else if (btoa[b] != a && !B[b]) {
            B[b] = lay;
            next.push_back(btoa[b]);
          }
        }
      if (islast) break;
      if (next.empty()) return res;
      for (auto& a : next) A[a] = lay;
      cur.swap(next);
    }
    for (int a = 0; a < ((int)(g).size()); ++a) res += dfs(a, 0, g, btoa, A, B);
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > e(m);
  for (pair<int, int>& x : e) {
    cin >> x.first >> x.second;
    x.first--;
    x.second--;
  }
  int ans = 1e8;
  for (int v = 0; v < n; v++) {
    vector<vector<int> > g(n);
    vector<int> btoa(n, -1);
    int good = 0;
    int bad = 0;
    for (pair<int, int> x : e) {
      if (x.first == v || x.second == v) {
        good++;
      } else {
        bad++;
        g[x.first].push_back(x.second);
      }
    }
    int match = hopcroftKarp(g, btoa);
    int cost = (2 * n - 1) - good + (bad - match) + (n - 1 - match);
    ans = min(cost, ans);
  }
  cout << ans << '\n';
}
