#include <bits/stdc++.h>
#pragma comment(linker, "/stack:30000000")
using namespace std;
const int mx[4] = {1, -1, 0, 0};
const int my[4] = {0, 0, 1, -1};
const int Direct[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
const int Nmax = 103000;
vector<vector<int> > g;
int match[Nmax];
int used[Nmax];
int n, m, u = 0;
vector<pair<int, int> > edge;
int kuhn(int v) {
  if (used[v] == u) return 0;
  used[v] = u;
  for (int i = 0; i < g[v].size(); i++) {
    int ver = g[v][i];
    if (match[ver] == -1 || kuhn(match[ver])) {
      match[ver] = v;
      return 1;
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  g.resize(n + 1);
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    edge.push_back(make_pair(x, y));
  }
  int tans = 2000000000;
  for (int it = 1; it <= n; ++it) {
    int cnt = 0, ans = 0, other = 0;
    for (int j = 1; j <= n; ++j) g[j].clear(), match[j] = -1;
    for (int j = 0; j <= m - 1; ++j) {
      if (edge[j].first == it || edge[j].second == it) {
        cnt++;
      } else {
        g[edge[j].first].push_back(edge[j].second);
        other++;
      }
    }
    for (int i = 1; i <= n; ++i) {
      u++;
      kuhn(i);
    }
    int tsz = 0;
    for (int i = 1; i <= n; ++i)
      if (match[i] != -1) tsz++;
    ans += 2 * (n - 1) + 1 - cnt + other - tsz + (n - 1) - tsz;
    tans = min(tans, ans);
  }
  cout << tans << endl;
  return 0;
}
