#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
vector<long long> g[110000];
long long col[110000];
bool z = false;
long long cnt1 = 0;
long long cnt2 = 0;
void dfs(long long k, long long step) {
  if (step % 2 == 0) cnt2++;
  if (step % 2 == 1) cnt1++;
  col[k] = step;
  for (long long i = 0; i < g[k].size(); i++)
    if (col[g[k][i]] == -1)
      dfs(g[k][i], step + 1);
    else if (col[g[k][i]] % 2 == step % 2)
      z = true;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  for (long long i = 0; i < 105000; i++) col[i] = -1;
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long x1, x2;
    cin >> x1 >> x2;
    x1--;
    x2--;
    g[x1].push_back(x2);
    g[x2].push_back(x1);
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++)
    if (col[i] == -1) {
      cnt1 = 0;
      cnt2 = 0;
      dfs(i, 0);
      ans += (cnt1 - 1) * cnt1 / 2 + (cnt2 - 1) * cnt2 / 2;
    }
  if (z)
    cout << "0 1";
  else {
    if (ans > 0)
      cout << "1 " << ans;
    else {
      if (n >= 3 && m >= 1) {
        cout << "2 " << m * (n - 2);
      } else if (m == 0 && n >= 3) {
        cout << "3 " << n * (n - 1) * (n - 2) / 6;
      } else
        cout << "0 1";
    }
  }
  return 0;
}
