#include <bits/stdc++.h>
using namespace std;
long long int ans;
long long int vis[100005];
long long int odd;
long long int even;
long long int in[100005];
std::vector<long long int> ve[100005];
long long int p[100005];
long long int deg[100005];
bool ok = true;
long long int tim = 0;
void dfs(long long int s, long long int pp) {
  if (vis[s] == 2) return;
  if (vis[s] == 1) {
    long long int cnt = 1;
    long long int curr = pp;
    while (curr != s) {
      cnt++;
      curr = p[curr];
    }
    if (cnt % 2) ok = false;
    return;
  }
  vis[s] = 1;
  p[s] = pp;
  in[s] = tim++;
  if (in[s] % 2)
    odd++;
  else
    even++;
  for (auto it : ve[s]) {
    if (it != pp) dfs(it, s);
  }
  vis[s] = 2;
  tim++;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  long long int maxn = 0;
  for (long long int i = 1; i <= m; i++) {
    long long int u, v;
    cin >> u >> v;
    deg[u]++;
    deg[v]++;
    ve[u].push_back(v);
    ve[v].push_back(u);
    maxn = max(maxn, max(deg[u], deg[v]));
  }
  if (maxn == 0) {
    ans = n * (n - 1) * (n - 2) / 6;
    cout << 3 << " " << ans << endl;
  }
  if (maxn == 1) {
    ans = m * (n - 2);
    cout << 2 << " " << ans << endl;
  }
  if (maxn > 1) {
    for (long long int i = 1; i <= n; i++) {
      if (!vis[i]) dfs(i, 0);
      ans = ans + (even * (even - 1)) / 2 + (odd * (odd - 1)) / 2;
      even = odd = 0;
    }
    if (!ok)
      cout << 0 << " " << 1 << endl;
    else {
      cout << 1 << " " << ans << endl;
    }
  }
  return 0;
}
