#include <bits/stdc++.h>
using namespace std;
const int N = 500 + 10;
int n, m, ans = 1e8 + 10;
int match[N][2];
bool loop[N], mark[N];
vector<int> adj[N][2];
void read_input() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    if (u == v) loop[u] = true;
    adj[u][0].push_back(v);
    adj[v][1].push_back(u);
  }
}
bool dfs(int u, int c) {
  mark[u] = true;
  for (int v : adj[u][0])
    if (v != c)
      if (!~match[v][1]) {
        match[match[u][0] = v][1] = u;
        return true;
      }
  for (int v : adj[u][0])
    if (v != c)
      if (!mark[match[v][1]] && dfs(match[v][1], c)) {
        match[match[u][0] = v][1] = u;
        return true;
      }
  return false;
}
int check(int c) {
  int cnt = 0;
  cnt += !loop[c];
  cnt += (n - 1 - (adj[c][0].size() - loop[c])) +
         (n - 1 - (adj[c][1].size() - loop[c]));
  memset(match, -1, sizeof match);
  int k = 0;
  while (true) {
    bool flag = false;
    memset(mark, false, sizeof mark);
    for (int u = 0; u < n; u++)
      if (u != c)
        if (!mark[u] && !~match[u][0] && dfs(u, c)) {
          flag = true;
          k++;
        }
    if (!flag) break;
  }
  int m2 = m - adj[c][0].size() - adj[c][1].size() + loop[c];
  cnt += m2 - k;
  cnt += n - 1 - k;
  return cnt;
}
void solve() {
  for (int i = 0; i < n; i++) ans = min(ans, check(i));
  cout << ans;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read_input(), solve();
}
