#include <bits/stdc++.h>
using namespace std;
const int N = 6e2;
vector<int> v[N];
int e[N][N], match[N], br;
bitset<N> viz, inmatch;
bool dfs(int x) {
  viz[x] = 1;
  for (int u : v[x]) {
    if (u == br) continue;
    if (match[u] == -1 || (!viz[match[u]] && dfs(match[u]))) {
      match[u] = x;
      return 1;
    }
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u1, u2;
    cin >> u1 >> u2;
    u1--;
    u2--;
    v[u1].emplace_back(u2);
    e[u1][u2] = 1;
  }
  int ans = 100000;
  for (int i = 0; i < n; i++) {
    int mas = n - 1 + (!e[i][i]);
    for (int j = 0; j < n; j++) {
      if (i != j) {
        mas += !e[i][j];
        mas += !e[j][i];
      }
    }
    bool flag = 1;
    br = i;
    inmatch.reset();
    memset(match, -1, sizeof(match));
    while (flag) {
      flag = 0;
      viz.reset();
      for (int j = 0; j < n; j++) {
        if (j == i) continue;
        if (inmatch[j] == 0 && dfs(j)) {
          inmatch[j] = 1;
          mas--;
          flag = 1;
        }
      }
    }
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        if (i == j || i == k) continue;
        if (match[k] != j) {
          mas += e[j][k];
        }
      }
    }
    ans = min(ans, mas);
  }
  cout << ans;
}
