#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1010;
const int Maxm = Maxn * Maxn * 2 + Maxn * 2 * 2;
const int Inf = 2100000000;
struct Edge {
  int v, nxt;
  int f;
  Edge() {}
  Edge(int v0, int n0, int f0) {
    v = v0;
    nxt = n0;
    f = f0;
  }
};
Edge e[Maxm * 2];
int head[Maxn];
int nume = 1;
inline void addEdge(int u, int v, int f) {
  e[++nume] = Edge(v, head[u], f);
  head[u] = nume;
  e[++nume] = Edge(u, head[v], 0);
  head[v] = nume;
}
int dist[Maxn];
queue<int> que;
int src, sink;
inline bool spfa() {
  while (!que.empty()) que.pop();
  memset(dist, -1, sizeof(dist));
  dist[src] = 0;
  que.push(src);
  while (!que.empty()) {
    int now = que.front();
    que.pop();
    for (int i = head[now]; i; i = e[i].nxt) {
      int v = e[i].v;
      if (e[i].f > 0 && dist[v] == -1) {
        dist[v] = dist[now] + 1;
        que.push(v);
      }
    }
  }
  if (dist[sink] == -1) return false;
  return true;
}
int dfs(int x, int delta) {
  if (x == sink) {
    return delta;
  } else {
    int ret = 0;
    for (int i = head[x]; i; i = e[i].nxt) {
      int v = e[i].v;
      if (e[i].f > 0 && dist[v] == dist[x] + 1) {
        int ddelta = dfs(v, min(e[i].f, delta));
        e[i].f -= ddelta;
        e[i ^ 1].f += ddelta;
        ret += ddelta;
        delta -= ddelta;
        if (delta == 0) break;
      }
    }
    if (!ret) dist[x] = -1;
    return ret;
  }
}
inline int dinic() {
  int ret = 0;
  while (spfa()) ret += dfs(src, Inf);
  return ret;
}
int n, m;
bool link[510][510];
int siz[510];
int inDeg[510];
int outDeg[510];
int minCost = Inf;
int Ans;
int mx = 0;
int main() {
  scanf("%d%d", &n, &m);
  src = n * 2 + 1, sink = n * 2 + 2;
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    link[x][y] = true;
    siz[x]++;
    if (x != y) siz[y]++;
  }
  for (int i = 1; i <= n; i++) mx = max(mx, siz[i]);
  for (int cet = 1; cet <= n; cet++) {
    if (mx != siz[cet]) continue;
    nume = 1;
    memset(head, 0, sizeof(head));
    for (int j = 1; j <= n; j++) {
      if (j == cet) continue;
      addEdge(src, j, 1);
      addEdge(n + j, sink, 1);
    }
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++)
        if (i != cet && j != cet) {
          if (link[i][j]) addEdge(i, n + j, 1);
        }
    Ans = ((2 * n - 1) - siz[cet]) + (m - siz[cet]) + (n - 1) - dinic() * 2;
    minCost = min(minCost, Ans);
  }
  printf("%d\n", minCost);
  return 0;
}
