#include <bits/stdc++.h>
int N, M, tot, c[1005], d[1005], x[1005], y[1005], next[1005], head[1005];
bool b[1005];
bool find(int u) {
  for (int i = head[u], v; v = y[i], i; i = next[i])
    if (!b[i] && d[v] != tot) {
      d[v] = tot;
      if (!c[v] || find(c[v])) return c[v] = u;
    }
  return 0;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= M; i++)
    scanf("%d%d", &x[i], &y[i]), next[i] = head[x[i]], head[x[i]] = i;
  int ans = 1e9;
  for (int i = 1; i <= N; i++) {
    int s = 0, t = 0;
    memset(b, 0, sizeof(b)), memset(c, 0, sizeof(c));
    for (int j = 1; j <= M; j++)
      if (x[j] == i || y[j] == i) s++, b[j] = 1;
    for (int j = 1; j <= N; j++) tot++, t += find(j);
    ans = std::min(ans, (2 * N - 1 - s) + (M - s - t) + (N - 1 - t));
  }
  printf("%d\n", ans);
}
