#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 1e3 + 5;
int n, m;
vector<pii> edgs;
vector<int> adjList[N];
struct BipartiteMatching {
  int n, match[N];
  bool used[N];
  vector<int> adjList[N];
  void reset() {
    for (int i = 0; i <= n; i++) {
      adjList[i].clear();
    }
  }
  bool kuhn(int v) {
    if (used[v]) return false;
    used[v] = true;
    for (int u : adjList[v]) {
      int mt = match[u];
      if (mt == -1 || kuhn(mt)) {
        match[u] = v;
        return true;
      }
    }
    return false;
  }
  int operator()() {
    memset(match, -1, sizeof match);
    for (int i = 1; i <= n; i++) {
      memset(used, 0, sizeof used);
      kuhn(i);
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      if (match[i] == -1) continue;
      ans += 1;
    }
    return ans;
  }
};
BipartiteMatching g;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    edgs.emplace_back(a, b);
  }
  g.n = n;
  int ans = INT_MAX;
  for (int s = 1; s <= n; s++) {
    g.reset();
    int cnt = 0;
    for (auto [u, v] : edgs) {
      if (u == s || v == s)
        cnt += 1;
      else
        g.adjList[u].emplace_back(v);
    }
    int mm = g();
    int add = 2 * n - 1 - cnt + n - 1 - mm;
    int del = m - cnt - mm;
    int can = add + del;
    ans = min(ans, can);
  }
  cout << ans << '\n';
  return 0;
}
