#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, m;
int g[511][511], gg[511][511], mat[511], vis[511];
int dfs(int x) {
  for (int i = (int)(1); i <= (int)(n); ++i) {
    if (!vis[i] && g[x][i]) {
      vis[i] = 1;
      if (!mat[i] || dfs(mat[i])) {
        mat[i] = x;
        return 1;
      }
    }
  }
  return 0;
}
int H() {
  int re = 0;
  for (int i = (int)(1); i <= (int)(n); ++i) {
    memset(vis, 0, sizeof(vis));
    if (dfs(i)) re++;
  }
  return re;
}
int main() {
  int t, i, j, k, x, y, z, ca = 1, re = 0;
  scanf("%d%d", &(n), &(m));
  for (int i = (int)(1); i <= (int)(m); ++i) {
    scanf("%d%d", &(x), &(y));
    gg[x][y] = 1;
  }
  re = 2000000000 + 10;
  for (int i = (int)(1); i <= (int)(n); ++i) {
    int use = 0, ans = 0;
    for (int j = (int)(1); j <= (int)(n); ++j) {
      if (i == j) {
        if (!gg[i][j])
          ans++;
        else
          use++;
      } else {
        if (!gg[i][j])
          ans++;
        else
          use++;
        if (!gg[j][i])
          ans++;
        else
          use++;
      }
    }
    memset(mat, 0, sizeof(mat));
    memcpy(g, gg, sizeof(g));
    for (int j = (int)(1); j <= (int)(n); ++j) g[i][j] = g[j][i] = 0;
    int match = H();
    use += match;
    re = min(re, m - use + ans + n - 1 - match);
  }
  printf("%d\n", (re));
  return 0;
}
