#include <bits/stdc++.h>
using namespace std;
mt19937_64 random_num(
    chrono::high_resolution_clock::now().time_since_epoch().count());
const int MOD = 1000000007;
const int base = 26;
int n, m;
pair<int, int> edge[1001];
vector<int> ke[501];
int T, match[501], visit[501];
int res = INT_MAX;
bool DFS(int u) {
  if (visit[u] == T) return 0;
  visit[u] = T;
  for (int v : ke[u])
    if (match[v] == 0 || DFS(match[v])) {
      match[v] = u;
      return 1;
    }
  return 0;
}
int calc(int center) {
  int cnt = 0, other = 0;
  for (int i = 1; i <= n; i++) {
    ke[i].clear();
    match[i] = 0;
  }
  for (int j = 1; j <= m; j++) {
    if (edge[j].first == center || edge[j].second == center)
      cnt++;
    else {
      ke[edge[j].first].push_back(edge[j].second);
      other++;
    }
  }
  int maxpair = 0;
  for (int i = 1; i <= n; i++)
    if (i != center) {
      T++;
      maxpair += DFS(i);
    }
  return (2 * (n - 1) - cnt + 1) + (other - maxpair) + ((n - 1) - maxpair);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    edge[i] = {u, v};
  }
  for (int i = 1; i <= n; i++) res = min(res, calc(i));
  cout << res;
}
