#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9, maxn = 1010;
vector<pair<int, int> > g;
vector<vector<int> > edge;
int used[maxn];
int mt[maxn], u = 0;
bool try_kuhn(int v) {
  if (used[v] == u) return false;
  used[v] = u;
  for (int i = 0; i < edge[v].size(); ++i) {
    int to = edge[v][i];
    if (mt[to] == -1 || try_kuhn(mt[to])) {
      mt[to] = v;
      return true;
    }
  }
  return false;
}
int main() {
  int n, m, res = INF;
  scanf("%d%d", &n, &m);
  edge.resize(n + 1);
  for (int i = 1; i <= m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    g.push_back(make_pair(a, b));
    edge[a].push_back(b);
  }
  for (int it = 1; it <= n; ++it) {
    int cnt = 0, ans = 0, other = 0;
    for (int j = 1; j <= n; ++j) edge[j].clear(), mt[j] = -1;
    for (int j = 0; j < m; ++j) {
      if (g[j].first == it || g[j].second == it) {
        cnt++;
      } else {
        edge[g[j].first].push_back(g[j].second);
        other++;
      }
    }
    for (int i = 1; i <= n; ++i) {
      u++;
      try_kuhn(i);
    }
    int tsz = 0;
    for (int i = 1; i <= n; ++i)
      if (mt[i] != -1) tsz++;
    ans += 2 * (n - 1) + 1 - cnt + other - tsz + (n - 1) - tsz;
    res = min(res, ans);
  }
  cout << res;
  return 0;
}
