#include <bits/stdc++.h>
using namespace std;
int maz[505][505], vis[505], match[505], edu[1005], edv[1005];
int n, m, ans;
bool dfs(int u) {
  int i;
  for (i = 1; i <= n; i++) {
    if (!vis[i] && maz[u][i]) {
      vis[i] = 1;
      if (!match[i] || dfs(match[i])) {
        match[i] = u;
        return true;
      }
    }
  }
  return false;
}
int bimatch() {
  int i, sol = 0;
  memset(match, 0, sizeof(match));
  for (i = 1; i <= n; i++) {
    memset(vis, 0, sizeof(vis));
    if (dfs(i)) sol++;
  }
  return sol;
}
int main() {
  int i, j, x, y, tmp;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) scanf("%d%d", &edu[i], &edv[i]);
  ans = n * n;
  for (i = 1; i <= n; i++) {
    x = 2 * n - 1;
    memset(maz, 0, sizeof(maz));
    for (j = 1; j <= m; j++) {
      if (edu[j] != i && edv[j] != i)
        maz[edu[j]][edv[j]] = 1;
      else
        x--;
    }
    y = 2 * n - 1 - x;
    ans = min(ans, n + m + x - y - 2 * bimatch() - 1);
  }
  printf("%d\n", ans);
  return 0;
}
