#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MAX = 505;
vector<int> adj[MAX];
int match[2][MAX], n, m, c;
bool mark[MAX];
bool dfs(int v) {
  if (v == c) return false;
  if (mark[v]) return false;
  mark[v] = true;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u == c) continue;
    if (match[1][u] == -1 || dfs(match[1][u])) {
      match[0][v] = u;
      match[1][u] = v;
      return true;
    }
  }
  return false;
}
bool good(int v) {
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (u == c) return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
  }
  int ans = INF;
  for (c = 1; c <= n; c++) {
    int keep = 0, add = 0, rem = 0;
    memset(match, -1, sizeof(match));
    while (true) {
      memset(mark, false, sizeof(mark));
      bool found = false;
      for (int v = 1; v <= n; v++)
        if (!mark[v] && match[0][v] == -1) found |= dfs(v);
      if (!found) break;
    }
    for (int v = 1; v <= n; v++) keep += (match[0][v] != -1);
    add = n - keep - 1;
    add += n - adj[c].size();
    keep += adj[c].size();
    for (int v = 1; v <= n; v++) {
      if (v == c) continue;
      if (good(v))
        keep++;
      else
        add++;
    }
    rem += m - keep;
    ans = min(ans, add + rem);
  }
  cout << ans;
  return 0;
}
