#include <bits/stdc++.h>
using namespace std;
bool way[501][501], marks[501];
int m, n, in[501], out[501], l[501], r[501], center, nxt[1000], head[1000],
    dest[1000], cnt;
void push(int first, int sec) {
  cnt++;
  dest[cnt] = sec;
  nxt[cnt] = head[first];
  head[first] = cnt;
}
bool dfs(int u) {
  for (int i = 1; i <= n; i++)
    if (center != i && way[u][i] && !marks[i]) {
      marks[i] = true;
      if (r[i] == -1 || dfs(r[i])) {
        l[u] = i;
        r[i] = u;
        return true;
      }
    }
  return false;
}
void kunh() {
  for (int i = 1; i <= n; i++) {
    if (center != i && l[i] == -1) {
      for (int j = 1; j <= n; j++) marks[j] = false;
      dfs(i);
    }
  }
}
int main() {
  int ans = 10000000;
  cnt = -1;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int f, s;
    scanf("%d %d", &f, &s);
    push(f, s);
    way[f][s] = 1;
  }
  for (int i = 1; i <= n; i++) {
    center = i;
    int potAns = 0;
    for (int j = 1; j <= n; j++) {
      if (!way[i][j]) potAns++;
      if (!way[j][i] && i != j) potAns++;
      l[j] = -1, r[j] = -1;
    }
    kunh();
    for (int j = 1; j <= n; j++)
      if (j != center)
        for (int k = 1; k <= n; k++)
          if (k != center && way[j][k]) {
            if (l[j] != k) potAns++;
          }
    for (int j = 1; j <= n; j++)
      if (center != j && r[j] == -1) potAns++;
    ans = min(ans, potAns);
  }
  printf("%d", ans);
  return 0;
}
