#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 500 + 5;
int n, m, deg[MAX_N], mch[MAX_N];
bool mark[MAX_N], mch_mark[MAX_N];
vector<int> adj[MAX_N];
void read_input() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    deg[u]++;
    if (u ^ v) deg[v]++;
  }
}
bool dfs(int v) {
  mark[v] = true;
  for (int u : adj[v])
    if (!~mch[u] || !mark[mch[u]] && dfs(mch[u])) {
      mch[u] = v;
      mch_mark[v] = true;
      return true;
    }
  return false;
}
void solve() {
  int ans = 1e9;
  for (int v = 0; v < n; v++) {
    memset(mch, -1, sizeof mch);
    memset(mch_mark, 0, sizeof mch_mark);
    mch_mark[v] = true;
    mch[v] = v;
    int max_mch = 0;
    for (int check = true; check; memset(mark, 0, sizeof mark)) {
      mark[v] = true;
      check = false;
      for (int i = 0; i < n; i++)
        if (!mark[i] && !mch_mark[i] && dfs(i)) max_mch++, check = true;
    }
    ans = min(ans, m - deg[v] - max_mch + n - 1 - max_mch + 2 * n - 1 - deg[v]);
  }
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read_input();
  solve();
  return 0;
}
