#include <bits/stdc++.h>
using namespace std;
long long n, i, j, d, m, x, y, p, k, max1, a[1005][1005], used[1005], mt[1600],
    e, l, rez;
string s1, s2, s;
vector<long long> graph[1500], backgraph[1500];
long long rows[1500], cols[1500], lal[1500];
bool try_kuhn(long long v) {
  if (used[v]) return false;
  used[v] = 1;
  for (int i = 0; i < graph[v].size(); i++) {
    long long to = graph[v][i];
    if ((mt[to] == -1 || try_kuhn(mt[to])) && to != j) {
      mt[to] = v;
      return true;
    }
  }
  return false;
}
int main() {
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    graph[x].push_back(y);
    rows[x]++;
    cols[y]++;
    if (x == y) lal[x] = 1;
  }
  rez = 100000000;
  for (j = 1; j <= n; j++) {
    x = j;
    long long cnt = 2 * n - 1 - (rows[x] + cols[x] - lal[x]);
    for (i = 1; i <= n; i++) mt[i] = -1;
    for (i = 1; i <= n; i++) {
      for (k = 1; k <= n; k++) used[k] = 0;
      used[j] = 1;
      try_kuhn(i);
    }
    long long tmp = 0;
    for (i = 1; i <= n; i++)
      if (mt[i] != -1) tmp++;
    cnt += (n - 1 - tmp) + m - (rows[x] + cols[x] - lal[x]) - tmp;
    rez = min(rez, cnt);
  }
  cout << rez << endl;
  return 0;
}
