#include <bits/stdc++.h>
using namespace std;

int n, m, answer=0;
int a[100002][2];

bool obshto (int x, int y) {
    if (a[x][0] == a[y][0] or a[x][0] == a[y][1] or a[x][1] == a[y][0] or a[x][1] == a[y][1]) {return true;}
    return false;
}

void func (int mask, int deca_left) {
    answer = max(answer, m - deca_left);
    if (deca_left <= 1) {return;}
    for (int i=1; i <= m; i++) {
        if ((mask & (1 << i)) != 0) {continue;}
        for (int j=i+1; j <= m; j++) {
            if ((mask & (1 << j)) != 0) {continue;}
            if (obshto (i, j) == false) {continue;}
            int mask1 = (mask | i);
            mask1 = (mask1 | j);
            func (mask1, deca_left-2);
        }
    }
    return;
}

int main () {
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);

cin >> n >> m;

for (int i=1; i <= m; i++) {
    cin >> a[i][0] >> a[i][1];
}

func (0, m);

cout << answer/2 << endl;

return 0;
}