#include <bits/stdc++.h>
using namespace std;
function<void(void)> ____ = []() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
};
const int MAXN = 555;
int n, m, match[MAXN];
bool mp[MAXN][MAXN], vis[MAXN];
vector<int> G[MAXN];
bool dfs(int u, int c) {
  vis[u] = true;
  for (int v : G[u]) {
    if (v == c) continue;
    if (match[v] == -1 or (!vis[match[v]] and dfs(match[v], c))) {
      match[v] = u;
      return true;
    }
  }
  return false;
}
int hungary(int c) {
  memset(match, 255, sizeof(match));
  int mt = 0;
  for (int i = 1; i <= n; i++) {
    if (i == c) continue;
    memset(vis, 0, sizeof(vis));
    if (dfs(i, c)) mt++;
  }
  return mt;
}
int main() {
  ____();
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    mp[u][v] = true;
  }
  int ret = MAXN * MAXN * MAXN;
  for (int i = 1; i <= n; i++) {
    int centeredge = 0;
    for (int j = 1; j <= n; j++) {
      if (i == j and mp[i][j])
        centeredge++;
      else if (i != j) {
        if (mp[i][j]) centeredge++;
        if (mp[j][i]) centeredge++;
      }
    }
    int mt = hungary(i);
    ret = min(ret, 3 * n + m - 2 - 2 * centeredge - 2 * mt);
  }
  cout << ret << endl;
  return 0;
}
