#include <bits/stdc++.h>
using namespace std;
const int N = 505;
int n, m;
bool c[N][N], vis[N];
vector<int> adj[N];
int match[2][N];
bool dfs(int u, int del) {
  if (vis[u]) return false;
  vis[u] = true;
  for (auto v : adj[u])
    if ((v ^ del)) {
      if (match[1][v] == -1 || dfs(match[1][v], del)) {
        match[0][u] = v;
        match[1][v] = u;
        return true;
      }
    }
  return false;
}
int khun(int del) {
  memset(match, -1, sizeof match);
  bool f = 1;
  int ret = 0;
  while (f) {
    memset(vis, 0, sizeof vis);
    f = 0;
    for (int i = 0; i < n; i++)
      if (i ^ del && match[0][i] == -1 && dfs(i, del)) f = 1, ret++;
  }
  return n - 1 - ret;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    c[u][v] = 1;
    adj[u].push_back(v);
  }
  int ans = INT_MAX;
  for (int i = 0; i < n; i++) {
    int ret = 0;
    for (int j = 0; j < n; j++)
      if (i ^ j) ret += (!c[i][j]) + (!c[j][i]);
    if (!c[i][i]) ret++;
    int x = m - 2 * n + 1 + ret;
    int tmp = khun(i);
    ans = min(ans, ret + 2 * tmp + x - (n - 1));
  }
  cout << ans << '\n';
  return 0;
}
