#include <bits/stdc++.h>
using namespace std;
const int maxx = 1e3 + 20;
vector<int> adj[maxx];
pair<int, int> e[maxx];
int match[maxx], dp[maxx], q[maxx], dm[maxx], n, m, deg[maxx], ans = 3 * maxx,
                                                               toghe[maxx];
bool vis[maxx];
bool dfs(int root) {
  vis[root] = true;
  for (int x : adj[root])
    if (match[x] == -1 || (!vis[match[x]] && dfs(match[x])))
      return match[x] = root, match[root] = x, true;
  return false;
}
int center(int x) {
  for (int i = 0; i < maxx; i++) adj[i].clear();
  for (int i = 0; i < m; i++)
    if (e[i].first != x && e[i].second != x)
      adj[e[i].first].push_back(e[i].second + n);
  fill(match, match + maxx, -1);
  int t = 0;
  for (int i = 0; i < n; i++) {
    if (i == x) continue;
    fill(vis, vis + maxx, false);
    t += dfs(i);
  }
  return n + n + n - 2 - t - t + m - q[x] - q[x];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    if (u == v)
      toghe[u] = 1, q[u]++;
    else
      dp[u]++, dm[v]++, q[u]++, q[v]++;
    e[i] = {u, v};
  }
  for (int i = 0; i < n; i++) ans = min(ans, center(i));
  cout << ans << endl;
  return 0;
}
