#include <bits/stdc++.h>
using namespace std;
const int N = 1000 + 5;
int n, m;
int a[N], b[N], p[N];
bool h[N];
vector<int> v[N];
bool match(int x) {
  h[x] = 1;
  for (auto u : v[x]) {
    if (!p[u] or (!h[p[u]] and match(p[u]))) {
      p[u] = x;
      return 1;
    }
  }
  return 0;
}
int solve(int x) {
  for (int i = 1; i <= n; i++) v[i].clear();
  int res = m + 2 * n + n - 2;
  for (int i = 1; i <= m; i++) {
    if (a[i] == x or b[i] == x)
      res -= 2;
    else {
      v[a[i]].push_back(b[i]);
    }
  }
  memset(p, 0, sizeof(p));
  for (int i = 1; i <= n; i++) {
    memset(h, 0, sizeof(h));
    if (match(i)) res -= 2;
  }
  return res;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d %d", a + i, b + i);
  int ans = 1e9;
  for (int i = 1; i <= n; i++) {
    ans = min(ans, solve(i));
  }
  printf("%d\n", ans);
  return 0;
}
