#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 100;
const int M = 4400000;
const int INF = 0x3f3f3f3f;
int s, t, n, m;
int h[N], e[M], ne[M], w[M], idx;
int cur[N], gap[N], d[N];
void add(int a, int b, int c) {
  e[idx] = b;
  w[idx] = c;
  ne[idx] = h[a];
  h[a] = idx++;
  e[idx] = a;
  w[idx] = 0;
  ne[idx] = h[b];
  h[b] = idx++;
}
int _;
void init(int s, int t) {
  queue<int> q;
  memset(d, 0, sizeof(d));
  memset(gap, 0, sizeof(gap));
  d[t] = 1, gap[1]++;
  q.push(t);
  for (int i = 0; i <= n + n + 1; i++) cur[i] = h[i];
  while (!q.empty()) {
    int t = q.front();
    q.pop();
    for (int i = h[t]; ~i; i = ne[i]) {
      int j = e[i];
      if (!d[j]) {
        d[j] = d[t] + 1;
        gap[d[j]]++;
        q.push(j);
      }
    }
  }
}
int dfs(int u, int t, int flow) {
  if (u == t) return flow;
  int flowed = 0;
  for (int &i = cur[u]; ~i; i = ne[i]) {
    int j = e[i];
    if (d[j] + 1 == d[u]) {
      int tmp = dfs(j, t, min(flow, w[i]));
      flowed += tmp;
      flow -= tmp;
      w[i] -= tmp;
      w[i ^ 1] += tmp;
      if (!flow) return flowed;
    }
  }
  gap[d[u]]--;
  if (!gap[d[u]]) d[s] = n + n + 3;
  d[u]++;
  gap[d[u]]++;
  cur[u] = h[u];
  return flowed;
}
int ISAP(int s, int t) {
  init(s, t);
  int ret = 0;
  while (d[s] <= n + n + 2) {
    ret += dfs(s, t, INF);
  }
  return ret;
}
int u[N], v[N], ma[N][N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u[i], &v[i]);
    ma[u[i]][v[i]] = 1;
  }
  int ans = INF;
  for (int i = 1; i <= n; i++) {
    memset(h, -1, sizeof(h));
    idx = 0;
    s = 0, t = n + n + 1;
    int tp = 0;
    for (int j = 1; j <= n; j++) add(s, j, 1), add(j + n, t, 1);
    for (int j = 1; j <= m; j++) {
      if (u[j] == i || v[j] == i) continue;
      add(u[j], v[j] + n, 1);
      tp++;
    }
    for (int j = 1; j <= n; j++) {
      if (!ma[i][j]) tp++;
      if (!ma[j][i]) tp++;
    }
    if (!ma[i][i]) tp--;
    int res = ISAP(s, t);
    ans = min(ans, tp - res + n - 1 - res);
  }
  cout << ans << '\n';
}
