#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
struct Hopcroft_Karp {
  static const int inf = 1e9;
  int n;
  vector<int> matchL, matchR, dist;
  vector<vector<int> > g;
  Hopcroft_Karp(int n)
      : n(n), matchL(n + 1), matchR(n + 1), dist(n + 1), g(n + 1) {}
  void addEdge(int u, int v) { g[u].push_back(v); }
  bool bfs() {
    queue<int> q;
    for (int u = 1; u <= n; u++) {
      if (!matchL[u]) {
        dist[u] = 0;
        q.push(u);
      } else
        dist[u] = inf;
    }
    dist[0] = inf;
    while (!q.empty()) {
      int u = q.front();
      q.pop();
      for (auto v : g[u]) {
        if (dist[matchR[v]] == inf) {
          dist[matchR[v]] = dist[u] + 1;
          q.push(matchR[v]);
        }
      }
    }
    return (dist[0] != inf);
  }
  bool dfs(int u) {
    if (!u) return true;
    for (auto v : g[u]) {
      if (dist[matchR[v]] == dist[u] + 1 && dfs(matchR[v])) {
        matchL[u] = v;
        matchR[v] = u;
        return true;
      }
    }
    dist[u] = inf;
    return false;
  }
  int max_matching() {
    int matching = 0;
    while (bfs()) {
      for (int u = 1; u <= n; u++) {
        if (!matchL[u])
          if (dfs(u)) matching++;
      }
    }
    return matching;
  }
};
unordered_map<int, int> mymap;
bool a[509][509];
int cal(int centre, int n) {
  int tot_op = 0, i, j, k;
  for (i = 1; i <= n; i++) {
    if (!a[centre][i]) {
      tot_op++;
    }
    if (!a[i][centre] && i != centre) {
      tot_op++;
    }
  }
  Hopcroft_Karp hkp(2 * n);
  int edg = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (i == centre || j == centre) {
        continue;
      }
      if (a[i][j]) {
        hkp.addEdge(i, j);
        edg++;
      }
    }
  }
  int match = hkp.max_matching();
  tot_op += (n - 1 - match) + (edg - match);
  return tot_op;
}
int main() {
  int i, j, k, n, m, x, y, z;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    a[x][y] = 1;
  }
  int ans = 1000000;
  for (i = 1; i <= n; i++) {
    ans = min(ans, cal(i, n));
  }
  cout << ans << endl;
  ;
}
