#include <bits/stdc++.h>
using namespace std;
int n, m;
int light;
vector<vector<int>> edges;
vector<vector<int>> graphC;
vector<vector<int>> graph;
vector<bool> dark;
vector<int> pred;
vector<bool> viewed;
queue<int> q;
bool Mp(int start) {
  if (start < n) {
    for (int i = 0; i < edges[start].size(); i++) {
      int vertex = edges[start][i];
      if (viewed[vertex]) continue;
      if (graphC[start][vertex] == 1) {
        if (!dark[vertex]) {
          pred[vertex] = start;
          viewed[vertex] = 1;
          light = vertex;
          return 1;
        } else {
          pred[vertex] = start;
          viewed[vertex] = 1;
          if (Mp(vertex)) return 1;
        }
      }
    }
  } else {
    for (int i = 0; i < edges[start].size(); i++) {
      int vertex = edges[start][i];
      if (viewed[vertex]) continue;
      if (graphC[start][vertex] == 2) {
        pred[vertex] = start;
        viewed[vertex] = 1;
        if (Mp(vertex)) return 1;
      }
    }
  }
  return 0;
}
int main() {
  cin >> n >> m;
  int u, v;
  graph = vector<vector<int>>(2 * n, vector<int>(2 * n, 0));
  graphC = vector<vector<int>>(2 * n, vector<int>(2 * n, 0));
  edges = vector<vector<int>>(2 * n, vector<int>());
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    u--;
    v--;
    graph[u][n + v] = 1;
    graphC[u][n + v] = 1;
    graph[n + v][u] = 1;
    graphC[n + v][u] = 1;
    edges[u].push_back(n + v);
    edges[n + v].push_back(u);
  }
  int minChange = INT_MAX;
  dark = vector<bool>(2 * n, 0);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2 * n; j++) {
      if (graphC[i][j] == 2) dark[j] = 0;
      if (graphC[n + i][j] == 2) dark[j] = 0;
    }
    dark[i] = 0;
    dark[n + i] = 0;
    for (int j = 0; j < 2 * n; j++) {
      graphC[i][j] = 0;
      graphC[j][i] = 0;
      graphC[n + i][j] = 0;
      graphC[j][n + i] = 0;
    }
    for (int j = 0; j < n; j++) {
      if (j == i || dark[j]) continue;
      pred = vector<int>(2 * n, -1);
      viewed = vector<bool>(2 * n, 0);
      if (Mp(j)) {
        int cur = light;
        int old;
        int color = 2;
        while (cur != j) {
          old = cur;
          cur = pred[cur];
          graphC[cur][old] = color;
          graphC[old][cur] = color;
          dark[old] = 1;
          dark[cur] = 1;
          if (color == 2)
            color = 1;
          else
            color = 2;
        }
      }
    }
    int change = 0;
    for (int j = 0; j < n; j++) {
      change += graph[i][n + j] == 0 ? 1 : 0;
      change += graph[j][n + i] == 0 ? 1 : 0;
    }
    if (graph[i][n + i] == 0) change -= 1;
    int Mvalue = 0;
    for (int j = 0; j < n; j++) {
      for (int k = n; k < 2 * n; k++) {
        change += graphC[j][k] == 1;
        Mvalue += graphC[j][k] == 2;
      }
    }
    change += (n - 1) - Mvalue;
    if (change < minChange) minChange = change;
    for (int j = n; j < 2 * n; j++) {
      graphC[i][j] = graph[i][j];
      graphC[j][i] = graph[j][i];
    }
    for (int j = 0; j < n; j++) {
      graphC[n + i][j] = graph[n + i][j];
      graphC[j][n + i] = graph[j][n + i];
    }
  }
  cout << minChange;
  return 0;
}
