#include <bits/stdc++.h>
using namespace std;
void RI(int& x) {
  x = 0;
  char c = getchar();
  while (!(c >= '0' && c <= '9' || c == '-')) c = getchar();
  bool flag = 1;
  if (c == '-') {
    flag = 0;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (!flag) x = -x;
}
void RII(int& x, int& y) { RI(x), RI(y); }
void RIII(int& x, int& y, int& z) { RI(x), RI(y), RI(z); }
void RC(char& c) {
  c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
}
char RC() {
  char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  return c;
}
const long long mod = 1e9 + 7;
const long long LINF = 1e18;
const int INF = 1e9;
const double EPS = 1e-8;
const int N = 1010;
vector<int> g[N];
int cx[N], cy[N], cnt, num[N], n;
bool vis[N];
bool findpath(int u) {
  for (int i = 0; i <= (int)g[u].size() - 1; i++) {
    int v = g[u][i];
    if (!vis[v]) {
      vis[v] = 1;
      if (cy[v] == -1 || findpath(cy[v])) {
        cx[u] = v;
        cy[v] = u;
        return true;
      }
    }
  }
  return false;
}
int main() {
  int m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    num[u]++;
    if (v != u) num[v]++;
  }
  int ans = INF;
  for (int i = 1; i <= n; i++) {
    int tm = 0;
    memset(cx, -1, sizeof(cx)), memset(cy, -1, sizeof(cy));
    for (int j = 1; j <= n; j++) {
      if (j == i) continue;
      if (cx[j] == -1) {
        memset(vis, 0, sizeof(vis));
        vis[i] = true;
        tm += findpath(j);
      }
    }
    int t = m - tm - num[i] + 3 * n - 2 - tm - num[i];
    ans = min(ans, t);
  }
  cout << ans << endl;
}
