//84104971101048411497 - Can you guess what does this mean?
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef complex<double> point;
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l, r) for(int i = (l); i <= (r); ++i)
#define forit(it, var) for(__typeof(var.begin()) it = var.begin(); it != var.end(); it++)
#define forrit(rit, var) for(__typeof(var.rbegin()) rit = var.rbegin(); rit != var.rend(); rit++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define maxN 105
#define oo 1000000007
#define sz(a) (int)a.size()
const double PI = acos(-1.0);
double fRand(double fMin, double fMax)
{
double f = (double)rand() / RAND_MAX;
return fMin + f * (fMax - fMin);
}
template <class T>
T min(T a, T b, T c) {
return min(a, min(b, c));
}
template <class T>
T max(T a, T b, T c) {
return max(a, max(b, c));
}
struct Edge {
int v, cap, f, rev;
};
struct MaxFlow {
vector<vector<Edge> > g;
int n;
MaxFlow(int n): n(n) {
g.assign(n, vector<Edge>());
}
void addEdge(int u, int v, int cap) {
g[u].pb({v, cap, 0, sz(g[v])});
g[v].pb({u, cap, 0, sz(g[u])-1});
}
void BFS(int s, int t, vector<int> &pNode, vector<int> &pEdge, vector<int> &delta) {
vector<bool> visited(n, false);
delta.assign(n, 0);
delta[s] = oo;
visited[s] = true;
queue<int> q;
q.push(s);
while (!q.empty()) {
int u = q.front(); q.pop();
fto(i, 0, sz(g[u])-1) {
int v = g[u][i].v, nflow = g[u][i].cap - g[u][i].f;
if (visited[v] || nflow == 0) continue;
visited[v] = true;
delta[v] = min(delta[u], nflow);
pNode[v] = u;
pEdge[v] = i;
q.push(v);
}
}
}
int getFlow(int s, int t, int maxF) {
fto(u, 0, n-1) {
fto(i, 0, sz(g[u])-1) g[u][i].f = 0;
}
vector<int> pNode(n);
vector<int> pEdge(n);
vector<int> delta(n);
int flow = 0;
while (true) {
BFS(s, t, pNode, pEdge, delta);
if (delta[t] == 0) break;
flow += delta[t];
if (flow >= maxF) break;
for(int v = t; v != s; v = pNode[v]) {
int u = pNode[v], i = pEdge[v];
g[u][i].f += delta[t];
g[v][g[u][i].rev].f -= delta[t];
}
}
return flow;
}
};
int n, m, c[maxN][maxN];
void Solve() {
MaxFlow g(n);
int maxF = (n == 0) ? 0 : oo;
fto(u, 0, n-1) {
int deg = 0;
fto(v, 0, n-1) {
deg += c[u][v];
if (v > u && c[u][v]) g.addEdge(u, v, c[u][v]);
}
maxF = min(maxF, deg);
}
fto(u, 0, n-1) {
fto(v, u+1, n-1) {
int x = g.getFlow(u, v, maxF);
maxF = min(maxF, x);
}
}
printf("%d\n", maxF);
memset(c, 0, sizeof c);
}
int toNum(string s) {
stringstream ss(s);
int x; ss >> x;
return x;
}
void read(int &u, int &v) {
string s; cin >> s;
int p = s.find(",");
u = toNum(s.substr(1, p-1)); v = toNum(s.substr(p+1, sz(s)-p-2));
}
int main () {
while (scanf("%d%d", &n, &m) != EOF) {
fto(i, 1, m) {
int u, v;
read(u, v);
++c[u][v]; ++c[v][u];
}
Solve();
}
return 0;
}
Ly84NDEwNDk3MTEwMTA0ODQxMTQ5NyAtIENhbiB5b3UgZ3Vlc3Mgd2hhdCBkb2VzIHRoaXMgbWVhbj8KI2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdHlwZWRlZiBsb25nIGxvbmcgbGw7CnR5cGVkZWYgY29tcGxleDxkb3VibGU+IHBvaW50OwojZGVmaW5lIG1hcGlpIG1hcDxpbnQsIGludD4KI2RlZmluZSBkZWJ1ZyhhKSBjb3V0IDw8ICNhIDw8ICI6ICIgPDwgYSA8PCBlbmRsCiNkZWZpbmUgZGVidWdhMShhLCBsLCByKSBmdG8oaSwgbCwgcikgY291dCA8PCBhW2ldIDw8ICIgIjsgY291dCA8PCBlbmRsCiNkZWZpbmU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V0sIG5mbG93KTsKICAgICAgICAgICAgICAgIHBOb2RlW3ZdID0gdTsKICAgICAgICAgICAgICAgIHBFZGdlW3ZdID0gaTsKICAgICAgICAgICAgICAgIHEucHVzaCh2KTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICBpbnQgZ2V0RmxvdyhpbnQgcywgaW50IHQsIGludCBtYXhGKSB7CiAgICAgICAgZnRvKHUsIDAsIG4tMSkgewogICAgICAgICAgICBmdG8oaSwgMCwgc3ooZ1t1XSktMSkgZ1t1XVtpXS5mID0gMDsKICAgICAgICB9CiAgICAgICAgdmVjdG9yPGludD4gcE5vZGUobik7CiAgICAgICAgdmVjdG9yPGludD4gcEVkZ2Uobik7CiAgICAgICAgdmVjdG9yPGludD4gZGVsdGEobik7CiAgICAgICAgaW50IGZsb3cgPSAwOwoKICAgICAgICB3aGlsZSAodHJ1ZSkgewogICAgICAgICAgICBCRlMocywgdCwgcE5vZGUsIHBFZGdlLCBkZWx0YSk7CiAgICAgICAgICAgIGlmIChkZWx0YVt0XSA9PSAwKSBicmVhazsKICAgICAgICAgICAgZmxvdyArPSBkZWx0YVt0XTsKICAgICAgICAgICAgaWYgKGZsb3cgPj0gbWF4RikgYnJlYWs7CgogICAgICAgICAgICBmb3IoaW50IHYgPSB0OyB2ICE9IHM7IHYgPSBwTm9kZVt2XSkgewogICAgICAgICAgICAgICAgaW50IHUgPSBwTm9kZVt2XSwgaSA9IHBFZGdlW3ZdOwogICAgICAgICAgICAgICAgZ1t1XVtpXS5mICs9IGRlbHRhW3RdOwogICAgICAgICAgICAgICAgZ1t2XVtnW3VdW2ldLnJldl0uZiAtPSBkZWx0YVt0XTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIGZsb3c7CiAgICB9Cn07CgppbnQgbiwgbSwgY1ttYXhOXVttYXhOXTsKCnZvaWQgU29sdmUoKSB7CiAgICBNYXhGbG93IGcobik7CgogICAgaW50IG1heEYgPSAobiA9PSAwKSA/IDAgOiBvbzsKICAgIGZ0byh1LCAwLCBuLTEpIHsKICAgICAgICBpbnQgZGVnID0gMDsKICAgICAgICBmdG8odiwgMCwgbi0xKSB7CiAgICAgICAgICAgIGRlZyArPSBjW3VdW3ZdOwogICAgICAgICAgICBpZiAodiA+IHUgJiYgY1t1XVt2XSkgZy5hZGRFZGdlKHUsIHYsIGNbdV1bdl0pOwogICAgICAgIH0KICAgICAgICBtYXhGID0gbWluKG1heEYsIGRlZyk7CiAgICB9CgogICAgZnRvKHUsIDAsIG4tMSkgewogICAgICAgIGZ0byh2LCB1KzEsIG4tMSkgewogICAgICAgICAgICBpbnQgeCA9IGcuZ2V0Rmxvdyh1LCB2LCBtYXhGKTsKICAgICAgICAgICAgbWF4RiA9IG1pbihtYXhGLCB4KTsKICAgICAgICB9CiAgICB9CgogICAgcHJpbnRmKCIlZFxuIiwgbWF4Rik7CiAgICBtZW1zZXQoYywgMCwgc2l6ZW9mIGMpOwp9CgppbnQgdG9OdW0oc3RyaW5nIHMpIHsKICAgIHN0cmluZ3N0cmVhbSBzcyhzKTsKICAgIGludCB4OyBzcyA+PiB4OwogICAgcmV0dXJuIHg7Cn0KCnZvaWQgcmVhZChpbnQgJnUsIGludCAmdikgewogICAgc3RyaW5nIHM7IGNpbiA+PiBzOwogICAgaW50IHAgPSBzLmZpbmQoIiwiKTsKICAgIHUgPSB0b051bShzLnN1YnN0cigxLCBwLTEpKTsgdiA9IHRvTnVtKHMuc3Vic3RyKHArMSwgc3oocyktcC0yKSk7Cn0KCmludCBtYWluICgpIHsKICAgIHdoaWxlIChzY2FuZigiJWQlZCIsICZuLCAmbSkgIT0gRU9GKSB7CiAgICAgICAgZnRvKGksIDEsIG0pIHsKICAgICAgICAgICAgaW50IHUsIHY7CiAgICAgICAgICAgIHJlYWQodSwgdik7CiAgICAgICAgICAgICsrY1t1XVt2XTsgKytjW3ZdW3VdOwogICAgICAgIH0KICAgICAgICBTb2x2ZSgpOwogICAgfQoKICAgIHJldHVybiAwOwp9Cg==