#include <bits/stdc++.h>
using namespace std;
int n, m;
int mat[512][512];
int indeg[512], outdeg[512];
vector<int> graph[512];
namespace HopcroftKarp {
const int MAX_N = 503, MAX_M = 503;
int n, m;
vector<int> graph[MAX_N];
int match[MAX_N];
int matched[MAX_M], depth[MAX_N], q[MAX_N];
int v[MAX_N], vcnt;
bool BFS() {
  int t = 0;
  for (int i = 0; i < n; i++)
    if (match[i] == -1)
      depth[i] = 0, q[t++] = i;
    else
      depth[i] = -1;
  for (int h = 0; h < t; h++) {
    int cur = q[h];
    int curDepth = depth[cur];
    for (int i = 0; i < graph[cur].size(); i++) {
      int adj = graph[cur][i];
      if (matched[adj] == -1) return true;
      int next = matched[adj];
      if (depth[next] != -1) continue;
      depth[next] = curDepth + 1, q[t++] = next;
    }
  }
  return false;
}
bool DFS(int nod) {
  v[nod] = vcnt;
  for (int i = 0; i < graph[nod].size(); i++) {
    int adj = graph[nod][i];
    int next = matched[adj];
    if (next >= 0 && (v[next] == vcnt || depth[next] != depth[nod] + 1))
      continue;
    if (next == -1 || DFS(next)) {
      match[nod] = adj;
      matched[adj] = nod;
      return true;
    }
  }
  return false;
}
int Match() {
  memset(match, -1, sizeof(match));
  memset(matched, -1, sizeof(matched));
  int ans = 0;
  while (BFS()) {
    ++vcnt;
    for (int i = 0; i < n; i++)
      if (depth[i] == 0 && DFS(i)) ans++;
  }
  return ans;
}
}  // namespace HopcroftKarp
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    a--, b--;
    indeg[b]++, outdeg[a]++;
    mat[a][b] = 1;
    graph[a].push_back(b);
  }
  int ans = INT_MAX;
  for (int i = 0; i < n; i++) {
    int cur = 0;
    HopcroftKarp::n = n - 1;
    HopcroftKarp::m = n - 1;
    for (int j = 0; j < n - 1; j++) HopcroftKarp::graph[j].clear();
    int totalEdges = 0;
    for (int j = 0; j < n; j++) {
      if (i == j) {
        if (mat[i][i] == 0) {
          cur++;
        }
        continue;
      }
      bool hasCenterIn = mat[j][i];
      bool hasCenterOut = mat[i][j];
      if (!hasCenterIn) cur++;
      if (!hasCenterOut) cur++;
      for (auto next : graph[j]) {
        if (next == i) continue;
        HopcroftKarp::graph[j - (j > i)].push_back(next - (next > i));
        totalEdges++;
      }
    }
    int left = HopcroftKarp::Match();
    cur += (totalEdges - left) + (n - 1 - left);
    ans = min(ans, cur);
  }
  printf("%d\n", ans);
  return 0;
}
