#include <bits/stdc++.h>
using namespace std;
bool debug = 1;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
vector<int> mp[505];
int ans = (1e8), in[505], out[505], center;
bool self[505];
const int maxn = 505;
int vis[maxn];
int cx[maxn], cy[maxn];
int line(int u) {
  for (int v : mp[u])
    if (v != center) {
      if (!vis[v]) {
        vis[v] = 1;
        if (cy[v] == -1 || line(cy[v])) {
          cx[u] = v;
          cy[v] = u;
          return 1;
        }
      }
    }
  return 0;
}
int maxmatch() {
  int sum = 0, i;
  memset(cx, 0xff, sizeof(cx));
  memset(cy, 0xff, sizeof(cy));
  for (i = 1; i <= n; i++) {
    if (cx[i] == -1 && i != center) {
      memset(vis, 0, sizeof(vis));
      sum += line(i);
    }
  }
  return sum;
}
void cal() {
  int tmp = n - 1 - out[center];
  tmp += n - 1 - in[center];
  if (!self[center]) tmp++;
  int edges = m - in[center] - out[center];
  if (self[center]) edges--;
  int mm = maxmatch();
  tmp += (edges - mm) + (n - 1 - mm);
  ans = min(ans, tmp);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int a, b, i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    mp[a].push_back(b);
    if (a == b)
      self[a] = 1;
    else {
      in[b]++;
      out[a]++;
    }
  }
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    center = i;
    cal();
  }
  printf("%d\n", ans);
  return 0;
}
