#include <bits/stdc++.h>
using namespace std;
const int max_n = 500 + 10;
vector<int> v[max_n], vv[max_n];
int mat[max_n];
int n, m;
bool mark[max_n], check[max_n];
bool dfs(int u) {
  if (mark[u]) return false;
  mark[u] = true;
  for (auto i : vv[u])
    if (mat[i] == -1 || dfs(mat[i])) {
      mat[i] = u;
      return true;
    }
  return false;
}
inline int cal(int k) {
  int cnt = (int)v[k].size();
  for (int i = 0; i < n; i++) {
    if (i == k) continue;
    bool c = false;
    for (auto j : v[i])
      if (j == k) c = true;
    if (c) cnt++;
  }
  for (int i = 0; i < n; i++) {
    vv[i].clear();
    if (i == k) continue;
    for (auto j : v[i])
      if (j != k) vv[i].push_back(j);
  }
  bool found = true;
  memset(mat, -1, sizeof mat);
  memset(check, 0, sizeof check);
  while (found) {
    memset(mark, 0, sizeof mark);
    found = false;
    for (int i = 0; i < n; i++) {
      if (!check[i] && dfs(i)) cnt++, found = true, check[i] = true;
    }
  }
  return cnt;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    v[x].push_back(y);
  }
  int ans = -1;
  for (int i = 0; i < n; i++) ans = max(ans, cal(i));
  cout << (m - ans) + (3 * n - 2 - ans) << endl;
}
