#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10;
const int MN = 5e2 + 10;
int match[2][MN];
bool mk[MN], is[MN];
int n, m;
vector<int> adj[MN];
int deg[MN];
bool dfs(int s, int bad) {
  mk[s] = true;
  for (auto v : adj[s])
    if (v != bad) {
      if (match[1][v] == -1 || (!mk[match[1][v]] && dfs(match[1][v], bad))) {
        match[1][v] = s;
        match[0][s] = v;
        return true;
      }
    }
  return false;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    adj[a].push_back(b), ++deg[b];
    if (a == b) is[a] = true;
  }
  int Mn = INF;
  for (int i = 0; i < n; ++i) {
    int rem = m - (((int)(adj[i]).size()) + deg[i] - is[i]);
    int res = (n - ((int)(adj[i]).size())) + (n - deg[i]) - (!is[i]);
    memset(match, -1, sizeof match);
    int M = 0;
    while (1) {
      bool finished = true;
      memset(mk, 0, sizeof mk);
      for (int j = 0; j < n; ++j)
        if (j != i && match[0][j] == -1 && dfs(j, i)) ++M, finished = false;
      if (finished) break;
    }
    res += (rem - M) + (n - 1 - M);
    Mn = min(Mn, res);
  }
  cout << Mn << '\n';
  return 0;
}
