#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
int n, m;
const int maxn = 555;
std::vector<int> G[maxn];
pair<int, int> a[1111];
int vis[maxn], p[maxn];
int dfs(int u) {
  for (int i = 0; i < ((int)(G[u]).size()); ++i) {
    int v = G[u][i];
    if (!vis[v]) {
      vis[v] = 1;
      if (p[v] == 0 || dfs(p[v])) {
        p[v] = u;
        return 1;
      }
    }
  }
  return 0;
}
int match() {
  int res = 0;
  for (int i = 1; i <= n; ++i) {
    memset(vis, 0, sizeof(vis));
    if (dfs(i)) {
      ++res;
    }
  }
  return res;
}
void init() {
  for (int i = 1; i <= n; ++i) {
    G[i].clear();
  }
  memset(p, 0, sizeof(p));
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  int res = inf;
  for (int c = 1; c <= n; ++c) {
    init();
    int cnt = 0;
    for (int i = 0; i < m; ++i) {
      if (a[i].first != c && a[i].second != c) {
        G[a[i].first].push_back(a[i].second);
      } else {
        ++cnt;
      }
    }
    res = min(res, 3 * n - 2 - cnt * 2 - match() * 2 + m);
  }
  cout << res << endl;
  return 0;
}
