#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
const int maxm = 1005;
int a[maxn][maxn], vis[maxm], ver[maxm], v[maxm][2];
int n, m, ans;
int dfs(int u) {
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && a[u][i]) {
      vis[i] = 1;
      if (!ver[i] || dfs(ver[i])) {
        ver[i] = u;
        return 1;
      }
    }
  }
  return 0;
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 1; i <= m; i++) scanf("%d%d", &v[i][0], &v[i][1]);
    ans = INT_MAX;
    for (int i = 1; i <= n; i++) {
      int num1 = 2 * n - 1;
      memset(a, 0, sizeof(a));
      memset(ver, 0, sizeof(ver));
      for (int j = 1; j <= m; j++) {
        if (v[j][0] != i && v[j][1] != i)
          a[v[j][0]][v[j][1]] = 1;
        else
          num1--;
      }
      int num2 = 2 * n - 1 - num1;
      int cnt = 0;
      for (int i = 1; i <= n; i++) {
        memset(vis, 0, sizeof(vis));
        if (dfs(i)) cnt++;
      }
      ans = min(ans, n + m + num1 - num2 - 2 * cnt - 1);
    }
    printf("%d\n", ans);
  }
  return 0;
}
