#include <bits/stdc++.h>
using namespace std;
vector<int> adj[200001];
long long n, m, a, b;
long long c1 = 0;
long long c2 = 0;
long long ans = 0;
int colorArr[100001];
bool bfs(int src) {
  colorArr[src] = 1;
  c2++;
  queue<int> q;
  q.push(src);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int v = 0; v < adj[u].size(); ++v) {
      if (colorArr[adj[u][v]] == -1) {
        colorArr[adj[u][v]] = 1 - colorArr[u];
        if (colorArr[adj[u][v]])
          c2++;
        else
          c1++;
        q.push(adj[u][v]);
      } else if (colorArr[adj[u][v]] == colorArr[u])
        return false;
    }
  }
  return true;
}
int check2() {
  for (int i = 1; i <= n; i++) {
    if (adj[i].size() > 1) return 0;
  }
  return 1;
}
int check0() {
  for (int i = 1; i < 100001; ++i) colorArr[i] = -1;
  for (int i = 1; i < n; i++) {
    if (colorArr[i] == -1) {
      c1 = 0;
      c2 = 0;
      if (bfs(i))
        ans += c1 * (c1 - 1) / 2 + c2 * (c2 - 1) / 2;
      else
        return 1;
    }
  }
  return 0;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  if (check0())
    cout << 0 << " " << 1;
  else if (m == 0) {
    cout << 3 << " " << n * (n - 1) * (n - 2) / 6;
  } else if (check2()) {
    cout << 2 << " " << m * (n - 2);
  } else {
    cout << 1 << " " << ans;
  }
  return 0;
}
