#include <bits/stdc++.h>
using namespace std;
vector<int> l[100005];
int c[100005];
bool f = false;
long long ans, n, m, sz[3];
void dfs(int k) {
  sz[c[k]]++;
  for (int i = 0; i < l[k].size(); i++) {
    int p = l[k][i];
    if (!c[p]) {
      c[p] = 3 - c[k];
      dfs(p);
    } else if (c[p] != (3 - c[k]))
      f = true;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    l[u].push_back(v);
    l[v].push_back(u);
  }
  ans = 0;
  for (int i = 1; i <= n; i++)
    if (!c[i]) {
      c[i] = 1;
      sz[2] = sz[1] = 0;
      dfs(i);
      ans += (long long)sz[2] * (sz[2] - 1) / 2 + sz[1] * (sz[1] - 1) / 2;
    }
  if (f)
    cout << 0 << " " << 1 << endl;
  else if (ans != 0)
    cout << 1 << " " << ans << endl;
  else if (m == 0)
    cout << 3 << " " << (long long)n * (n - 1) * (n - 2) / 6 << endl;
  else
    cout << 2 << " " << (long long)m * (n - 2) << endl;
  return 0;
}
