#include <bits/stdc++.h>
using namespace std;
const int MX = 505;
int n, m, skoj[MX * 2], d[MX * 2];
vector<int> g[MX], adj[MX];
bool vis[MX * 2];
bool mac[MX * 2][MX * 2];
void bfs() {
  vector<int> Q;
  for (int i = 1; i <= n; i++) {
    d[i] = -1;
    if (!skoj[i]) {
      d[i] = 0;
      Q.push_back(i);
    }
  }
  for (int z = 0; z < Q.size(); z++) {
    int u = Q[z];
    for (int i = 0; i < adj[u].size(); i++) {
      int v = skoj[adj[u][i]];
      if (v != 0 && d[v] == -1) {
        d[v] = d[u] + 1;
        Q.push_back(v);
      }
    }
  }
}
bool dfs(int u) {
  vis[u] = true;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (!skoj[v] || (!vis[skoj[v]] && d[skoj[v]] == d[u] + 1 && dfs(skoj[v]))) {
      skoj[u] = v;
      skoj[v] = u;
      return true;
    }
  }
  return false;
}
int max_match() {
  for (int i = 1; i <= 2 * n; i++) skoj[i] = 0;
  bool poprawilem = true;
  while (poprawilem) {
    poprawilem = false;
    fill(vis + 1, vis + n + 1, false);
    bfs();
    for (int i = 1; i <= n; i++) {
      if (!skoj[i]) poprawilem |= dfs(i);
    }
  }
  int out = 0;
  for (int i = 1; i <= n; i++) {
    if (skoj[i]) out++;
  }
  return out;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    mac[u][v] = true;
  }
  int wyn = MX * MX * MX;
  for (int center = 1; center <= n; center++) {
    int center_indeg = 0, center_outdeg = 0, total = 0;
    for (int i = 1; i <= n; i++) adj[i].clear();
    for (int i = 1; i <= n; i++)
      for (int j = 0; j < g[i].size(); j++) {
        if (i != center && g[i][j] != center) {
          adj[i].push_back(n + g[i][j]);
          total++;
        } else {
          if (i == center) center_outdeg++;
          if (g[i][j] == center) center_indeg++;
        }
      }
    bool z = !mac[center][center];
    int mm = max_match();
    int rem = total - mm;
    int add = n - 1 - mm;
    wyn = min(wyn, 2 * n - center_indeg - center_outdeg + rem + add - z);
  }
  printf("%d\n", wyn);
  return 0;
}
