#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, cnt, sum, con, other, ans, now, oo = 0x3ffff;
int head[1005], q[1005], d[1005], u[5005], v[5005];
struct ff {
  int to, nxt, len;
} e[5005];
bool vis[1005][1005];
void add(int u, int v, int len) {
  e[++cnt] = (ff){v, head[u], len};
  head[u] = cnt;
}
bool build() {
  memset(d, -1, sizeof(d));
  d[0] = 0;
  int l = 1, r = 1;
  q[1] = 0;
  while (l <= r) {
    for (int i = head[q[l]]; i; i = e[i].nxt) {
      int v = e[i].to;
      if (e[i].len && d[v] == -1) {
        d[v] = d[q[l]] + 1;
        if (v == 2 * n + 1) return 1;
        q[++r] = v;
      }
    }
    l++;
  }
  return 0;
}
int dfs(int now, int flow) {
  if (now == 2 * n + 1 || !flow) return flow;
  int w = 0, res;
  for (int i = head[now]; i; i = e[i].nxt) {
    int v = e[i].to;
    if (e[i].len && d[v] == d[now] + 1 &&
        (res = dfs(v, min(e[i].len, flow - w))))
      w += res, e[i].len -= res, e[i ^ 1].len += res;
  }
  if (!w) d[now] = -1;
  return w;
}
int main() {
  scanf("%d %d", &n, &m);
  for (i = 1; i <= m; i++) scanf("%d %d", &u[i], &v[i]);
  ans = oo;
  for (i = 1; i <= n; i++) {
    cnt = 1, con = other = 0;
    memset(head, 0, sizeof(head));
    for (j = 1; j <= m; j++)
      if (u[j] == i || v[j] == i)
        con++;
      else
        add(u[j], v[j] + n, 1), add(v[j] + n, u[j], 0), other++;
    for (j = 1; j <= n; j++)
      add(0, j, 1), add(j, 0, 0), add(j + n, 2 * n + 1, 1),
          add(2 * n + 1, j + n, 0);
    sum = 0;
    while (build())
      while (1) {
        int flow = dfs(0, oo);
        if (!flow) break;
        sum += flow;
      }
    ans = min(ans, 2 * n - 1 - con + other - sum + (n - 1) - sum);
  }
  printf("%d\n", ans);
  return 0;
}
