#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
long long ans = 0;
bool cok = false;
int col[MAXN];
bool marked[MAXN];
vector<int> edges[MAXN];
int sz[2];
void dfs(int v) {
  marked[v] = true;
  ans += sz[col[v]];
  sz[col[v]]++;
  for (int i = 0; i < edges[v].size(); i++) {
    int u = edges[v][i];
    if (!marked[u]) {
      col[u] = col[v] ^ 1;
      dfs(u);
    } else if (col[u] != (col[v] ^ 1))
      cok = true;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    edges[u].push_back(v);
    edges[v].push_back(u);
  }
  for (int i = 0; i < n; i++)
    if (!marked[i]) {
      sz[0] = sz[1] = 0;
      dfs(i);
    }
  if (cok)
    cout << 0 << " " << 1 << endl;
  else if (ans == 0) {
    if (m == 0) {
      long long ans = n;
      ans *= n - 1;
      ans *= n - 2;
      ans /= 6;
      cout << 3 << " " << ans << endl;
    } else
      cout << 2 << " " << (long long)m * (n - 2) << endl;
  } else
    cout << 1 << " " << ans << endl;
}
