#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> graf[505];
int vis[1005], skoj[1005], deg[505][2];
int s, res, lp = 1;
bool dfs(int a) {
  vis[a] = lp;
  for (auto v : graf[a]) {
    if (v == s + n) continue;
    if (!skoj[v] || (vis[skoj[v]] != lp && dfs(skoj[v]))) {
      skoj[v] = a;
      return true;
    }
  }
  return false;
}
void match() {
  for (int i = 1; i <= 2 * n; i++) {
    skoj[i] = 0;
    vis[i] = 0;
  }
  res = 0, lp = 1;
  for (int i = 1; i <= n; i++) {
    if (i == s) continue;
    if (dfs(i))
      res++;
    else {
      lp++;
      if (dfs(i)) res++;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graf[a].push_back(b + n);
    deg[a][0]++;
    if (a != b) deg[b][1]++;
  }
  int wyn = 1e9;
  for (int i = 1; i <= n; i++) {
    s = i;
    match();
    int temp = 2 * n - 1 - (deg[i][0] + deg[i][1]);
    temp += n - 1 - res;
    temp += m - res - (deg[i][0] + deg[i][1]);
    wyn = min(wyn, temp);
  }
  cout << wyn << "\n";
  return 0;
}
