#include <bits/stdc++.h>
const int maxn = 500 + 10;
using namespace std;
int dir[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}, n, m, link[maxn << 1],
    vis[maxn << 1], a[maxn][maxn];
vector<int> G[maxn << 1];
pair<int, int> p[maxn << 1];
int dfs(int u) {
  for (auto v : G[u]) {
    if (vis[v]) continue;
    vis[v] = 1;
    if (link[v] == 0 || dfs(link[v])) {
      link[v] = u;
      return 1;
    }
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    a[u][v] = 1;
    p[i].first = u;
    p[i].second = v;
  }
  int ans = 1e9;
  for (int i = 1; i <= n; i++) {
    int tmp = 0, res = 0;
    if (a[i][i] == 0)
      tmp++;
    else
      res++;
    for (int j = 1; j <= n; j++)
      if (i != j) {
        if (!a[i][j])
          tmp++;
        else
          res++;
        if (!a[j][i])
          tmp++;
        else
          res++;
      }
    for (int j = 1; j <= 2 * n; j++) G[j].clear();
    memset(link, 0, sizeof link);
    for (int j = 1; j <= m; j++) {
      int u = p[j].first, v = p[j].second;
      if (u == i || v == i)
        ;
      else
        G[u].push_back(n + v);
    }
    int x = 0;
    for (int j = 1; j <= n; j++)
      if (j != i) {
        memset(vis, 0, sizeof vis);
        x += dfs(j);
      }
    tmp += (n - 1 - x);
    tmp += (m - res - x);
    ans = min(ans, tmp);
  }
  cout << ans;
  return 0;
}
