#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int n, m, s, t;
namespace Graph {
int head[1005], cnt;
bool vis[1005][2];
struct Edge {
  int next, to;
} e[100005];
void push(int x, int y) {
  cnt++;
  e[cnt].to = y;
  e[cnt].next = head[x];
  head[x] = cnt;
}
void init() {
  int x, y;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    push(x, y);
  }
}
}  // namespace Graph
namespace network_flow {
int head[1005], cnt = 1, dep[1005];
struct Edge {
  int next, to, w;
} e[100005];
void add(int x, int y, int w) {
  cnt++;
  e[cnt].to = y;
  e[cnt].next = head[x];
  e[cnt].w = w;
  head[x] = cnt;
}
void push(int x, int y, int w) {
  add(x, y, w);
  add(y, x, 0);
}
int encode(int x, int type) { return type * n + x; }
int init(int V) {
  using Graph::vis;
  memset(vis, false, sizeof(vis));
  memset(head, 0, sizeof(head)), cnt = 1;
  int ret = n * 2 - 1;
  for (int x = 1; x <= n; x++) {
    for (int i = Graph::head[x]; i; i = Graph::e[i].next) {
      int v = Graph::e[i].to;
      if (x == V) {
        ret -= !vis[v][0];
        vis[v][0] = 1;
        continue;
      } else if (v == V) {
        ret -= !vis[x][1];
        vis[x][1] = 1;
        continue;
      }
      push(encode(x, 0), encode(v, 1), 1);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i == V) continue;
    push(s, encode(i, 0), 1);
    push(encode(i, 1), t, 1);
  }
  return ret;
}
bool bfs() {
  memset(dep, 0, sizeof(dep));
  queue<int> q;
  q.push(s);
  dep[s] = 1;
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    for (int i = head[x]; i; i = e[i].next) {
      int v = e[i].to;
      if (dep[v] || !e[i].w) continue;
      dep[v] = dep[x] + 1;
      q.push(v);
    }
  }
  return dep[t];
}
int dfs(int x, int in) {
  if (x == t) return in;
  int out = 0;
  for (int i = head[x]; i; i = e[i].next) {
    int v = e[i].to;
    if (dep[v] != dep[x] + 1 || !e[i].w) continue;
    int ret = dfs(v, min(in, e[i].w));
    e[i].w -= ret;
    e[i ^ 1].w += ret;
    in -= ret;
    out += ret;
    if (!in) return out;
  }
  if (!out) dep[x] = 0;
  return out;
}
int dinic() {
  int ans = 0;
  while (bfs()) ans += dfs(s, inf);
  return ans;
}
int work(int V) {
  int K = init(V);
  int ret = dinic();
  int ans = (m - (n * 2 - 1 - K) - ret) + K + n - 1 - ret;
  return ans;
}
}  // namespace network_flow
int main() {
  cin >> n >> m;
  s = n * 2 + 1, t = s + 1;
  Graph::init();
  int ans = inf;
  for (int i = 1; i <= n; i++) {
    ans = min(ans, network_flow::work(i));
  }
  cout << ans << endl;
  return 0;
}
