#include <bits/stdc++.h>
using namespace std;
const int MAXN = 505;
int n, m;
int head[MAXN];
int fo[MAXN << 1];
int edge[MAXN << 1];
int next1[MAXN << 1];
int mp[MAXN][MAXN];
int vis[MAXN << 1];
int cx[MAXN << 1];
int esz;
int head2[MAXN << 1];
int edge2[MAXN << 1];
int next2[MAXN << 1];
int esz2;
void addedge(int u, int v) {
  fo[esz] = u;
  edge[esz] = v;
  next1[esz] = head[u];
  head[u] = esz++;
}
void addedge2(int u, int v) {
  edge2[esz2] = v;
  next2[esz2] = head2[u];
  head2[u] = esz2++;
}
int dfs(int u) {
  for (int i = head2[u]; i + 1; i = next2[i]) {
    int v = edge2[i];
    if (vis[v]) continue;
    vis[v] = 1;
    if (cx[v] == -1 || dfs(cx[v])) {
      cx[u] = v;
      cx[v] = u;
      return 1;
    }
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  memset(head, -1, sizeof(head));
  while (m--) {
    int u, v;
    scanf("%d%d", &u, &v);
    addedge(u, v);
    mp[u][v] = 1;
  }
  int ans = 1000000000;
  for (int i = 1; i <= n; i++) {
    int res = 0;
    for (int j = 1; j <= n; j++) {
      if (mp[i][j] == 0) res++;
      if (i != j && mp[j][i] == 0) res++;
    }
    memset(head2, -1, sizeof(head2));
    esz2 = 0;
    int cnt = 0;
    for (int j = 0; j < esz; j++) {
      int u = fo[j], v = edge[j];
      if (u == i || v == i) continue;
      addedge2(u * 2 - 1, v * 2);
      cnt++;
    }
    int ok = 1;
    memset(cx, -1, sizeof(cx));
    while (ok) {
      ok = 0;
      memset(vis, 0, sizeof(vis));
      for (int j = 1; j <= 2 * n; j += 2)
        if (cx[j] == -1) ok |= dfs(j);
    }
    for (int j = 1; j <= 2 * n; j += 2) {
      if (j == i * 2 - 1) continue;
      if (cx[j] != -1)
        cnt--;
      else
        cnt++;
    }
    ans = min(ans, cnt + res);
  }
  printf("%d\n", ans);
  return 0;
}
