#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x7f7f7f7f;
long long n, m, g[505][505], s, t, ans = INF;
long long mxf;
long long ee = 1, h[2005], nex[5005 << 1], to[5005 << 1], val[5005 << 1];
long long dep[2005];
void addedge(long long x, long long y, long long z) {
  nex[++ee] = h[x];
  to[ee] = y;
  val[ee] = z;
  h[x] = ee;
}
bool bfs() {
  memset(dep, 0, sizeof(dep));
  queue<long long> q;
  dep[s] = 1;
  q.push(s);
  while (!q.empty()) {
    long long x = q.front();
    q.pop();
    for (long long i = h[x]; i; i = nex[i])
      if (val[i] && dep[to[i]] == 0) {
        dep[to[i]] = dep[x] + 1;
        q.push(to[i]);
      }
  }
  return dep[t] != 0;
}
long long dfs(long long x, long long flow) {
  if (x == t) return flow;
  for (long long i = h[x]; i; i = nex[i])
    if (val[i] && dep[to[i]] == dep[x] + 1) {
      long long d = dfs(to[i], min(flow, val[i]));
      if (d > 0) {
        val[i] -= d;
        val[i ^ 1] += d;
        return d;
      }
    }
  return 0;
}
void dinic() {
  mxf = 0;
  while (bfs()) {
    long long x = 1;
    while (x != 0) {
      x = dfs(s, INF);
      mxf += x;
    }
  }
}
void init_() {
  mxf = 0, ee = 1;
  s = n * 2 + 1, t = n * 2 + 2;
  memset(h, 0, sizeof(h));
}
signed main() {
  cin >> n >> m;
  for (long long i = 1, x, y; i <= m && cin >> x >> y; i++) g[x][y] = 1;
  for (long long p = 1; p <= n; p++) {
    init_();
    long long res = 0;
    for (long long i = 1; i <= n; i++) {
      if (!g[p][i]) res++;
      if (i != p && !g[i][p]) res++;
    }
    for (long long i = 1; i <= n; i++)
      if (i != p) {
        addedge(s, i, 1), addedge(i, s, 0);
        addedge(i + n, t, 1), addedge(t, i + n, 0);
      }
    for (long long i = 1; i <= n; i++)
      for (long long j = 1; j <= n; j++)
        if (i != p && j != p && g[i][j])
          addedge(i, j + n, 1), addedge(j + n, i, 0);
    dinic();
    res += n - 1 - mxf;
    for (long long x = 1; x <= n; x++)
      for (long long i = h[x]; i; i = nex[i])
        if (to[i] != s && val[i ^ 1] == 0) res++;
    ans = min(ans, res);
  }
  cout << ans << endl;
  return 0;
}
