#include <bits/stdc++.h>
using namespace std;
stack<time_t> time_stack;
void startTimer() { time_stack.push(clock()); }
double stopTimer() {
  double time = clock() - time_stack.top();
  time_stack.pop();
  return time / double(CLOCKS_PER_SEC);
}
double sqr(double x) { return x * x; }
int n, m;
vector<vector<int> > g;
vector<char> used;
vector<int> mt;
int cntr;
bool try_kuhn(int v) {
  if (used[v]) return false;
  used[v] = true;
  for (auto x : g[v]) {
    if (x != cntr && (mt[x] == -1 || try_kuhn(mt[x]))) {
      mt[x] = v;
      return true;
    }
  }
  return false;
}
int main() {
  startTimer();
  ios::sync_with_stdio(false);
  string TASK = "immediate";
  cout.precision(9);
  cout << fixed;
  cin >> n >> m;
  g.resize(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
  }
  int ans = 1e9;
  for (cntr = 0; cntr < n; cntr++) {
    int cnt = 0;
    bool fl = false;
    for (int u = 0; u < n; u++)
      for (auto it : g[u])
        if (u == cntr && it == cntr)
          fl = true;
        else if (u == cntr || it == cntr)
          cnt++;
    int edges = m - cnt - int(fl);
    mt.assign(n, -1);
    used.assign(n, false);
    used[cntr] = true;
    int size_mt = 0;
    for (int i = 0; i < n; i++)
      if (try_kuhn(i)) {
        used.assign(n, false);
        used[cntr] = true;
        size_mt++;
      }
    int res =
        int(!fl) + (2 * (n - 1) - cnt) + (n - 1 - size_mt) + (edges - size_mt);
    ans = min(res, ans);
  }
  cout << ans;
  cout << endl;
  return 0;
}
