#include <bits/stdc++.h>
using namespace std;
long long G(long long a, long long b) {
  if (b == 0) return a;
  return G(b, a % b);
}
long long n, m, adj[555][555], matchR[555];
bool seen[555];
bool bpm(long long cnt, long long r) {
  for (int i = 0; i < n; i++) {
    if (i == cnt) continue;
    if (!seen[i] && adj[r][i]) {
      seen[i] = 1;
      if (matchR[i] < 0 || bpm(cnt, matchR[i])) {
        matchR[i] = r;
        return 1;
      }
    }
  }
  return 0;
}
long long maxBPM(long long cnt) {
  long long res = 0;
  memset(matchR, -1, sizeof(matchR));
  for (int i = 0; i < n; i++) {
    if (i == cnt) continue;
    memset(seen, 0, sizeof(seen));
    if (bpm(cnt, i)) res++;
  }
  return res;
}
long long center(long long r) {
  long long ret = 0, cnt = 0, oth = 0;
  for (int i = 0; i < n; i++)
    if (adj[r][i]) cnt++;
  for (int i = 0; i < n; i++)
    if (adj[i][r]) cnt++;
  if (adj[r][r]) cnt--;
  oth = m - cnt;
  long long k = maxBPM(r);
  return 2 * n - 1 - cnt + oth - k + n - 1 - k;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    a--, b--;
    adj[a][b]++;
  }
  long long ans = 1000000;
  for (int i = 0; i < n; i++) ans = min(ans, center(i));
  cout << ans;
}
