#include <bits/stdc++.h>
using namespace std;
int sum, match[1010];
bool visit[1010];
int n, m, root;
int g[510][510];
int in[510], out[510];
bool dfs(int x) {
  for (int i = 1; i <= n; i++) {
    if (i == root) continue;
    if (g[x][i] && !visit[i]) {
      visit[i] = true;
      if (match[i] == -1 || dfs(match[i])) {
        match[i] = x;
        return true;
      }
    }
  }
  return false;
}
int maxmatch() {
  memset(match, -1, sizeof(match));
  sum = 0;
  match[root] = -1;
  for (int i = 1; i <= n; i++) {
    if (i == root) continue;
    memset(visit, false, sizeof(visit));
    if (dfs(i)) sum++;
  }
  return sum;
}
int main() {
  scanf("%d%d", &n, &m);
  memset(g, 0, sizeof(g));
  memset(in, 0, sizeof(in));
  memset(out, 0, sizeof(out));
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    in[y]++;
    out[x]++;
    g[x][y] = 1;
  }
  int ans = 2100000000;
  for (root = 1; root <= n; root++) {
    int A = in[root] + out[root] - g[root][root];
    int mat = maxmatch();
    ans = min(ans, 3 * n - 2 - A * 2 + m - 2 * mat);
  }
  printf("%d", ans);
  return 0;
}
