#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int ed, next;
} edge[1024];
int head[512], nEdge;
int matchx[512], matchy[512], disx[512], disy[512], dis;
int que[512], front, tail;
bool vis[512];
void init() {
  memset(head, -1, sizeof(head));
  nEdge = 0;
}
void addEdge(int a, int b) {
  edge[nEdge].ed = b;
  edge[nEdge].next = head[a];
  head[a] = nEdge++;
}
bool bfs(int v) {
  int i, x, y;
  front = tail = 0;
  dis = 0x3F3F3F3F;
  memset(disx, -1, sizeof(disx));
  memset(disy, -1, sizeof(disy));
  for (i = 0; i < v; ++i) {
    if (matchx[i] < 0) disx[que[tail++] = i] = 0;
  }
  while (front < tail) {
    if (disx[x = que[front++]] > dis) break;
    for (i = head[x]; ~i; i = edge[i].next) {
      if (disy[y = edge[i].ed] < 0) {
        disy[y] = disx[x] + 1;
        if (matchy[y] < 0)
          dis = disy[y];
        else
          disx[que[tail++] = matchy[y]] = disy[y] + 1;
      }
    }
  }
  return dis < 0x3F3F3F3F;
}
bool dfs(int x) {
  int i, y;
  for (i = head[x]; ~i; i = edge[i].next) {
    if (!vis[y = edge[i].ed] && disy[y] == disx[x] + 1) {
      vis[y] = true;
      if ((~matchy[y]) && disy[y] == dis) continue;
      if (matchy[y] < 0 || dfs(matchy[y])) {
        matchx[x] = y;
        matchy[y] = x;
        return true;
      }
    }
  }
  return false;
}
int maxMatch(int v) {
  int ret = 0, i;
  memset(matchx, -1, sizeof(matchx));
  memset(matchy, -1, sizeof(matchy));
  while (bfs(v)) {
    memset(vis, 0, sizeof(vis));
    for (i = 0; i < v; ++i) {
      if (matchx[i] < 0 && dfs(i)) ++ret;
    }
  }
  return ret;
}
int u[1024], v[1024], deg[512][2];
bool tag[512];
int calc(int n, int m, int c) {
  int i, sum, cnt = 0;
  init();
  for (i = 0; i < m; ++i) {
    if (u[i] != c && v[i] != c) {
      addEdge(u[i], v[i]);
      ++cnt;
    }
  }
  sum = maxMatch(n);
  return cnt - sum + n - sum - 1;
}
int main() {
  int n, m, i, ans, cur;
  while (~scanf("%d %d", &n, &m)) {
    memset(deg, 0, sizeof(deg));
    memset(tag, 0, sizeof(tag));
    for (i = 0; i < m; ++i) {
      scanf("%d %d", &u[i], &v[i]);
      ++deg[--u[i]][0];
      ++deg[--v[i]][1];
      if (u[i] == v[i]) tag[u[i]] = true;
    }
    for (ans = 0x3F3F3F3F, i = 0; i < n; ++i) {
      cur = calc(n, m, i) + n - deg[i][0] + n - deg[i][1] - (tag[i] == false);
      ans = min(ans, cur);
    }
    printf("%d\n", ans);
  }
  return 0;
}
