#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 5;
int n, m;
bool g[maxn][maxn];
bool vis[maxn];
int from[maxn];
bool hungary(int x) {
  for (int i = 1; i <= n; i++) {
    if (g[x][i] && !vis[i]) {
      vis[i] = true;
      if (from[i] == -1 || hungary(from[i])) {
        from[i] = x;
        return true;
      }
    }
  }
  return false;
}
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a][b] = true;
  }
  int res = 0x3f3f3f3f;
  for (int i = 1; i <= n; i++) {
    vector<int> in, out;
    for (int j = 1; j <= n; j++) {
      if (i != j) {
        if (g[i][j]) {
          out.push_back(j);
          g[i][j] = false;
        }
        if (g[j][i]) {
          in.push_back(j);
          g[j][i] = false;
        }
      }
    }
    bool self_loop = g[i][i];
    g[i][i] = false;
    int cur = n - 1 - in.size() + n - 1 - out.size() + (self_loop == false);
    int match = 0;
    memset(from, -1, sizeof(from));
    for (int j = 1; j <= n; j++) {
      memset(vis, false, sizeof(vis));
      if (hungary(j)) {
        match++;
      }
    }
    cur += m - in.size() - out.size() - self_loop - match + n - 1 - match;
    if (res > cur) {
      res = cur;
    }
    for (int j : in) {
      g[j][i] = true;
    }
    for (int j : out) {
      g[i][j] = true;
    }
    g[i][i] = self_loop;
  }
  printf("%d", res);
  return 0;
}
