#include <bits/stdc++.h>
using namespace std;
const int MAXN = 502;
bool marked[MAXN];
int match[2][MAXN];
vector<int> adj[MAXN];
int n, m;
int degs[MAXN];
bool dfs(int v, int forb) {
  if (marked[v]) return false;
  marked[v] = true;
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int u = adj[v][i];
    if (u == forb) continue;
    if (match[1][u] == -1 || dfs(match[1][u], forb)) {
      match[0][v] = u;
      match[1][u] = v;
      return true;
    }
  }
  return false;
}
int matching(int forb) {
  memset(match, -1, sizeof match);
  int ans = 0;
  for (int j = 0; j < n; j++) {
    bool found = false;
    memset(marked, 0, sizeof marked);
    for (int i = 1; i <= n; i++)
      if (i != forb && !marked[i] && match[0][i] == -1 && dfs(i, forb)) {
        ans++;
        found = true;
      }
    if (!found) break;
  }
  return ans;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    degs[a]++;
    if (a != b) degs[b]++;
  }
  int ans = 1e9;
  for (int i = 1; i <= n; i++) {
    int mat = matching(i);
    ans = min(ans, (2 * n - 1) - degs[i] + (m - degs[i]) - mat + (n - 1) - mat);
  }
  cout << ans << endl;
  return 0;
}
