#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  int N, M, ans = 1234567890;
  cin >> N >> M;
  vector<vector<int> > G0(N);
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    G0[--a].push_back(--b);
  }
  vector<vector<int> > F(2 * N, vector<int>(2 * N, 0));
  vector<vector<int> > G(2 * N);
  for (int c = 0; c < N; c++) {
    int akt = G0[c].size();
    for (int i = 0; i < N; i++)
      if (i != c)
        for (auto it = G0[i].begin(); it != G0[i].end(); it++)
          if (*it == c) akt++;
    if (M - akt + (N - 2 - akt) >= ans) continue;
    for (int i = 0; i < N; i++)
      if (i != c) {
        F[0][i + 1 - int(i > c)] = 1;
        G[0].push_back(i + 1 - int(i > c));
        G[i + 1 - int(i > c)].push_back(0);
      }
    for (int i = 0; i < N; i++)
      if (i != c) {
        F[N + i - int(i > c)][2 * N - 1] = 1;
        G[2 * N - 1].push_back(N + i - int(i > c));
        G[N + i - int(i > c)].push_back(2 * N - 1);
      }
    for (int i = 0; i < N; i++)
      if (i != c)
        for (auto it = G0[i].begin(); it != G0[i].end(); it++)
          if (*it != c) {
            F[i + 1 - int(i > c)][N + *it - int(*it > c)] = 1;
            G[i + 1 - int(i > c)].push_back(N + *it - int(*it > c));
            G[N + *it - int(*it > c)].push_back(i + 1 - int(i > c));
            if (F[0][i + 1 - int(i > c)] &&
                F[N + *it - int(*it > c)][2 * N - 1]) {
              F[0][i + 1 - int(i > c)] = F[N + *it - int(*it > c)][2 * N - 1] =
                  0;
              F[i + 1 - int(i > c)][0] = F[2 * N - 1][N + *it - int(*it > c)] =
                  1;
              F[i + 1 - int(i > c)][N + *it - int(*it > c)] = 0;
              F[N + *it - int(*it > c)][i + 1 - int(i > c)] = 1;
              akt++;
            }
          }
    vector<int> ako(2 * N, -1), inQ;
    ako[0] = 0;
    queue<int> q;
    while (true) {
      q.push(0);
      while (!q.empty()) {
        if (ako[2 * N - 1] != -1) break;
        for (auto it = G[q.front()].begin(); it != G[q.front()].end(); it++)
          if (ako[*it] == -1 && F[q.front()][*it] > 0) {
            ako[*it] = q.front();
            inQ.push_back(*it);
            q.push(*it);
          }
        q.pop();
      }
      while (!q.empty()) q.pop();
      if (ako[2 * N - 1] == -1) break;
      akt++;
      int a = 2 * N - 1;
      while (a > 0) {
        F[ako[a]][a]--;
        F[a][ako[a]]++;
        a = ako[a];
      }
      for (auto it = inQ.begin(); it != inQ.end(); it++) ako[*it] = -1;
      inQ.clear();
    }
    for (int i = 0; i < 2 * N; i++) {
      G[i].clear();
    }
    for (int i = 0; i < N; i++)
      if (i != c)
        for (auto it = G0[i].begin(); it != G0[i].end(); it++)
          if (*it != c) {
            F[i + 1 - int(i > c)][N + *it - int(*it > c)] = 0;
            F[N + *it - int(*it > c)][i + 1 - int(i > c)] = 0;
          }
    for (int i = 0; i < N; i++)
      if (i != c) F[0][i + 1 - int(i > c)] = F[i + 1 - int(i > c)][0] = 0;
    for (int i = 0; i < N; i++)
      if (i != c)
        F[N + i - int(i > c)][2 * N - 1] = F[2 * N - 1][N + i - int(i > c)] = 0;
    ans = min(ans, M - akt + (N - 1 + 1 + 2 * (N - 1) - akt));
  }
  cout << ans << "\n";
  return 0;
}
