#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int u[333], v[333];
int main()
{
freopen("changeb.in", "r", stdin);
freopen("changeb.out", "w", stdout);
int n, m;
scanf("%d %d", &n, &m);
for(int i = 0; i < m; i++)
scanf("%d %d", u+i, v+i);
int ans = 0x23333333;
for(int i = 0; i < (1<<n); i++)
{
int c = 0;
for(int j = 0; j < m; j++)
if((1&(i>>u[j])) == (1&(i>>v[j])))
c++;
ans = min(ans, c);
}
printf("%d\n", ans);
return 0;
}