#include <bits/stdc++.h>
using namespace std;
int get() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && (c != '-'))
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return flag ? -x : x;
}
void output(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  int len = 0, data[10];
  while (x) {
    data[len++] = x % 10;
    x /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
  putchar('\n');
}
const int inf = 1000000000;
vector<int> g[500];
int mate[500];
bool flag[500];
bool dfs(int x) {
  if (x == -1) return true;
  if (flag[x]) return false;
  flag[x] = true;
  for (int i = 0; i < g[x].size(); i++) {
    int y = g[x][i];
    if (dfs(mate[y])) {
      mate[y] = x;
      return true;
    }
  }
  return false;
}
int main() {
  int n = get(), m = get(), ans = inf;
  static int x[1000], y[1000];
  static bool adj[500][500];
  memset(g, 0, sizeof(g));
  for (int i = 0; i < m; i++) {
    x[i] = get() - 1;
    y[i] = get() - 1;
    adj[x[i]][y[i]] = true;
  }
  for (int root = 0; root < n; root++) {
    int sum = adj[root][root] ^ 1;
    for (int i = 0; i < n; i++)
      if (i != root) sum += (adj[i][root] ^ 1) + (adj[root][i] ^ 1);
    for (int i = 0; i < n; i++) g[i].clear();
    sum += n - 1;
    for (int i = 0; i < m; i++)
      if (x[i] != root && y[i] != root) {
        g[x[i]].push_back(y[i]);
        sum++;
      }
    memset(mate, -1, sizeof(mate));
    for (int i = 0; i < n; i++) {
      memset(flag, 0, sizeof(flag));
      if (dfs(i)) sum -= 2;
    }
    ans = min(ans, sum);
  }
  output(ans);
  return 0;
}
