#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> h[500], hv[500];
bool hur[500];
int par[500], parv[500];
bool eler[500];
bool dfs(int p) {
  eler[p] = 1;
  for (int q : h[p]) {
    if ((parv[q] < 0) || ((!eler[parv[q]]) && (dfs(parv[q])))) {
      par[p] = q;
      parv[q] = p;
      return 1;
    }
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    h[x].push_back(y);
    hv[y].push_back(x);
    if (x == y) hur[x] = 1;
  }
  int sol(9999999);
  int lp(-1);
  for (int v = 0; v < n; v++) {
    int s(0);
    int cntwi = h[v].size() + hv[v].size() - hur[v];
    s = (2 * n) - (1 + cntwi);
    fill(par, par + n, -1);
    fill(parv, parv + n, -1);
    int db(0);
    for (int i = 0; i < n; i++) {
      fill(eler, eler + n, 0);
      eler[v] = 1;
      par[v] = v;
      parv[v] = v;
      for (int j = 0; j < n; j++) {
        if (eler[j]) continue;
        if (par[j] >= 0) continue;
        if (dfs(j)) {
          db++;
          break;
        }
      }
    }
    int other = m - cntwi;
    s += (other - db) + ((n - 1) - db);
    sol = min(sol, s);
    if (sol == s) lp = db;
  }
  cout << sol << endl;
  return 0;
}
