#include <bits/stdc++.h>
using namespace std;
class Kuhn {
 private:
  vector<vector<int> > graph;
  int n;
  int k;
  vector<bool> used;
  vector<int> matching;

 public:
  Kuhn() {}
  Kuhn(vector<vector<int> > graph, int n, int k) {
    this->graph = graph;
    this->n = n;
    this->k = k;
    this->used.resize(n, false);
    this->matching.resize(k, -1);
    this->run_algorithm();
  }
  int get_max_matching() {
    int max_matching = 0;
    for (unsigned int i = 0; i < this->matching.size(); ++i) {
      if (this->matching[i] != -1) max_matching++;
    }
    return max_matching;
  }

 private:
  void run_algorithm() {
    for (int i = 0; i < this->n; ++i) {
      for (int j = 0; j < n; ++j) used[j] = false;
      this->try_kuhn(i);
    }
  }
  bool try_kuhn(int v) {
    if (this->used[v]) return false;
    this->used[v] = true;
    for (unsigned int i = 0; i < this->graph[v].size(); ++i) {
      int to = this->graph[v][i];
      if (this->matching[to] == -1 || this->try_kuhn(this->matching[to])) {
        this->matching[to] = v;
        return true;
      }
    }
    return false;
  }
};
int main() {
  int n, m, a, b;
  scanf("%d%d", &n, &m);
  vector<vector<int> > graph(n);
  vector<int> count_edges(n);
  int count = 0;
  while (count < m) {
    scanf("%d%d", &a, &b);
    a--;
    b--;
    graph[a].push_back(b);
    count_edges[a]++;
    if (a != b) count_edges[b]++;
    ++count;
  }
  int result = -1;
  for (int center = 0; center < n; ++center) {
    vector<vector<int> > tmp_graph(n);
    for (int i = 0; i < n; ++i) {
      if (i != center)
        for (unsigned int j = 0; j < graph[i].size(); ++j)
          if (graph[i][j] != center) tmp_graph[i].push_back(graph[i][j]);
    }
    Kuhn kuhn(tmp_graph, n, n);
    int max_matching = kuhn.get_max_matching();
    int tmp_result = 2 * n - 1 - count_edges[center] +
                     (m - count_edges[center]) - max_matching + (n - 1) -
                     max_matching;
    result = result == -1 ? tmp_result : min(result, tmp_result);
  }
  printf("%d\n", result);
  return 0;
}
