#include <bits/stdc++.h>
using namespace std;
const int BUF = 505;
const int INF = 1 << 20;
int n;
bool adj[BUF][BUF];
void read() {
  memset(adj, 0, sizeof(adj));
  int nEdge;
  cin >> n >> nEdge;
  for (int i = 0; i < nEdge; ++i) {
    int s, t;
    cin >> s >> t;
    --s;
    --t;
    adj[s][t] = true;
  }
}
bool aug(int cur, bool visited[BUF], int L2R[BUF], int R2L[BUF],
         bool a[BUF][BUF]) {
  if (cur == -1) return true;
  visited[cur] = true;
  for (int i = 0; i < n; ++i) {
    if (!a[cur][i]) continue;
    if (R2L[i] != -1 && visited[R2L[i]]) continue;
    if (aug(R2L[i], visited, L2R, R2L, a)) {
      L2R[cur] = i;
      R2L[i] = cur;
      return true;
    }
  }
  return false;
}
int maxMatch(bool a[BUF][BUF]) {
  int ret = 0;
  int L2R[BUF], R2L[BUF];
  memset(L2R, -1, sizeof(L2R));
  memset(R2L, -1, sizeof(R2L));
  for (int i = 0; i < n; ++i) {
    bool visited[BUF] = {};
    ret += aug(i, visited, L2R, R2L, a);
  }
  return ret;
}
void work() {
  int minV = INF;
  for (int center = 0; center < n; ++center) {
    int sumCenter = adj[center][center] ? 0 : 1;
    int sumOther = 0;
    bool subAdj[BUF][BUF] = {};
    for (int i = 0; i < n; ++i) {
      if (i == center) continue;
      if (!adj[i][center]) ++sumCenter;
      if (!adj[center][i]) ++sumCenter;
      for (int j = 0; j < n; ++j) {
        if (j == center) continue;
        if (adj[i][j]) {
          ++sumOther;
          subAdj[i][j] = true;
        }
      }
    }
    minV = min(minV, sumCenter + sumOther + n - 1 - maxMatch(subAdj) * 2);
  }
  cout << minV << endl;
}
int main() {
  read();
  work();
  return 0;
}
