#include <bits/stdc++.h>
using namespace std;
int n;
bool adj[567][567];
struct Matching {
  int n;
  vector<int> matchL, matchR, dist;
  vector<bool> seen;
  vector<vector<int> > ke;
  Matching(int n)
      : n(n),
        matchL(n + 1),
        matchR(n + 1),
        dist(n + 1),
        seen(n + 1, false),
        ke(n + 1) {}
  void addEdge(int u, int v) { ke[u].push_back(v); }
  bool bfs() {
    queue<int> qu;
    for (int u = 1; u <= n; ++u)
      if (!matchL[u]) {
        dist[u] = 0;
        qu.push(u);
      } else
        dist[u] = INT_MAX;
    dist[0] = INT_MAX;
    while (!qu.empty()) {
      int u = qu.front();
      qu.pop();
      for (__typeof(ke[u].begin()) v = ke[u].begin(); v != ke[u].end(); ++v)
        if (dist[matchR[*v]] == INT_MAX) {
          dist[matchR[*v]] = dist[u] + 1;
          qu.push(matchR[*v]);
        }
    }
    return dist[0] != INT_MAX;
  }
  bool dfs(int u) {
    if (u) {
      for (__typeof(ke[u].begin()) v = ke[u].begin(); v != ke[u].end(); ++v)
        if (dist[matchR[*v]] == dist[u] + 1 && dfs(matchR[*v])) {
          matchL[u] = *v;
          matchR[*v] = u;
          return true;
        }
      dist[u] = INT_MAX;
      return false;
    }
    return true;
  }
  int match() {
    int res = 0;
    while (bfs()) {
      for (int u = 1; u <= n; ++u)
        if (!matchL[u])
          if (dfs(u)) ++res;
    }
    return res;
  }
};
int magic(int v, Matching& g) {
  int ans = 0;
  for (int i = 1; i <= n; ++i) ans += 2 - adj[i][v] - adj[v][i];
  if (!adj[v][v]) ans--;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != v && j != v && adj[i][j]) g.addEdge(i, j + n);
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  int m;
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u][v] = true;
  }
  int ans = INT_MAX;
  for (int i = 1; i <= n; ++i) {
    Matching g(2 * n + 1);
    int x = magic(i, g);
    x += n - 1 + m - (2 * n - 1 - x) - 2 * g.match();
    ans = min(ans, x);
  }
  cout << ans << '\n';
  return 0;
}
