#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(const T& a) {
  return a * a;
}
template <typename T>
inline int sign(const T& a) {
  return a < 0 ? -1 : a > 0;
}
void task();
int main() {
  task();
  return 0;
}
const int N = 555;
vector<int> g[N];
int mt[N];
int used[N];
int n, m;
int ans = 1e9;
int cur;
int in[N];
bool kuhn(int v) {
  if (used[v]) return 0;
  used[v] = 1;
  for (int to : g[v]) {
    if (to == cur) continue;
    if (mt[to] == -1 || kuhn(mt[to])) {
      mt[to] = v;
      return 1;
    }
  }
  return 0;
}
void task() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    --a, --b;
    g[a].push_back(b);
    if (a != b) in[b]++;
  }
  for (cur = 0; cur < n; ++cur) {
    memset(mt, -1, sizeof(mt));
    int cnt = 0;
    for (int i = 0; i < n; ++i)
      if (i != cur) {
        memset(used, 0, sizeof(used));
        cnt += kuhn(i);
      }
    ans = min(ans, 2 * (n - 1) + 1 - (int)g[cur].size() - in[cur] + m -
                       (int)g[cur].size() - in[cur] - cnt + n - 1 - cnt);
  }
  printf("%d", ans);
}
