#include <bits/stdc++.h>
using namespace std;
const int MAXN = 510;
int n, m;
vector<int> g[MAXN];
int in[MAXN];
bool mk[MAXN];
int from[MAXN];
int center;
bool kuhn(int u) {
  if (mk[u]) {
    return false;
  }
  mk[u] = true;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v == center) {
      continue;
    }
    if (!from[v] || kuhn(from[v])) {
      from[v] = u;
      return true;
    }
  }
  return false;
}
int solve(int c) {
  center = c;
  int fixed = in[center] + g[center].size();
  int sol = (2 * n - 1) - fixed;
  int mxf = 0;
  fill(from, from + n + 1, 0);
  for (int i = 1; i <= n; i++) {
    if (i == center) {
      continue;
    }
    fill(mk, mk + n + 1, false);
    if (kuhn(i)) {
      mxf++;
    }
  }
  sol += (m - fixed) - mxf;
  sol += (n - 1) - mxf;
  return sol;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    if (u != v) {
      in[v]++;
    }
  }
  int sol = n * n;
  for (int i = 1; i <= n; i++) {
    sol = min(sol, solve(i));
  }
  cout << sol << '\n';
}
