#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 3;
const long double eps = 1e-9;
int n, m, ans, p[N];
bool us[N];
vector<int> g[N];
pair<int, int> e[N];
bool kun(int v) {
  if (us[v]) return false;
  us[v] = true;
  for (int i : g[v])
    if (p[i] == -1 || kun(p[i])) {
      p[i] = v;
      return true;
    }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> e[i].first >> e[i].second;
    e[i].first--;
    e[i].second--;
  }
  ans = 2 * N;
  for (int it = 0; it < n; ++it) {
    int cnI = 0, oth = 0, par = 0;
    for (int i = 0; i < n; ++i) g[i].clear();
    fill(p, p + n, -1);
    fill(us, us + n, false);
    for (int i = 0; i < m; ++i) {
      if (e[i].first == it || e[i].second == it)
        cnI++;
      else {
        oth++;
        g[e[i].first].push_back(e[i].second);
      }
    }
    for (int i = 0; i < n; ++i)
      if (kun(i)) {
        par++;
        fill(us, us + n, false);
      }
    ans = min(ans, 3 * n - 2 - cnI + oth - 2 * par);
  }
  cout << ans;
}
