Imagine a city with n junctions and m streets. Junctions are numbered from 1 to n.

In order to increase the traffic flow, mayor of the city has decided to make each street one-way. This means in the street between junctions u and v, the traffic moves only from u to v or only from v to u. 

The problem is to direct the traffic flow of streets in a way that maximizes the number of pairs (u, v) where 1 ≤ u, v ≤ n and it is possible to reach junction v from u by passing the streets in their specified direction. Your task is to find out maximal possible number of such pairs.

Input

The first line of input contains integers n and m, (<image>), denoting the number of junctions and streets of the city.

Each of the following m lines contains two integers u and v, (u ≠ v), denoting endpoints of a street in the city.

Between every two junctions there will be at most one street. It is guaranteed that before mayor decision (when all streets were two-way) it was possible to reach each junction from any other junction.

Output

Print the maximal number of pairs (u, v) such that that it is possible to reach junction v from u after directing the streets.

Examples

Input

5 4
1 2
1 3
1 4
1 5


Output

13


Input

4 5
1 2
2 3
3 4
4 1
1 3


Output

16


Input

2 1
1 2


Output

3


Input

6 7
1 2
2 3
1 3
1 4
4 5
5 6
6 4


Output

27

Note

In the first sample, if the mayor makes first and second streets one-way towards the junction 1 and third and fourth streets in opposite direction, there would be 13 pairs of reachable junctions: {(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (2, 1), (3, 1), (1, 4), (1, 5), (2, 4), (2, 5), (3, 4), (3, 5)}
#include <bits/stdc++.h>
using namespace std;
const int N = 2000 + 10;
int n, col, h[N], mn[N], cnt[N], dp[N];
vector<int> adj[N], adj_c[N];
bool e[N][N], mark[N];
bitset<N> B;
void dfs(int u = 0, int l = 0) {
  mn[u] = h[u] = l, mark[u] = true;
  for (auto v : adj[u])
    if (!mark[v])
      dfs(v, l + 1), mn[u] = min(mn[u], mn[v]);
    else if (h[v] != h[u] - 1)
      mn[u] = min(mn[u], h[v]);
}
void dfs_cnt(int u = 0, int c = 0) {
  cnt[c]++, mark[u] = true;
  for (auto v : adj[u])
    if (!mark[v])
      if (mn[v] <= h[u])
        dfs_cnt(v, c);
      else {
        adj_c[c].push_back(col + 1);
        adj_c[col + 1].push_back(c);
        dfs_cnt(v, ++col);
      }
}
int dfs_c(int u, int par = -1) {
  int ans = dp[u] = 0;
  for (auto v : adj_c[u])
    if (v != par) ans += dfs_c(v, u), dp[u] += dp[v];
  ans += (dp[u] += cnt[u]) * cnt[u];
  return ans;
}
int calc(int u) {
  int ans = dfs_c(u);
  B.reset(), B[0] = true;
  for (auto v : adj_c[u]) B |= B << dp[v];
  for (int i = (n - cnt[u]) / 2; ~i; i--)
    if (B[i]) return ans + i * (n - cnt[u] - i);
}
void readInput() {
  int m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
}
void solve() {
  int ans = 0;
  for (int i = 0; i <= col; i++) ans = max(ans, calc(i));
  cout << ans << endl;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  readInput(), dfs(), memset(mark, false, sizeof mark), dfs_cnt(), solve();
  return 0;
}
