#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
double eps = 1e-10;
using namespace std;
template <typename Type>
void print_vector(vector<Type> &v) {
  for (int i = 0; i < v.size(); i++) cout << v[i];
  puts("");
}
long long n, m, cnt1, cnt2, ans;
int used[100005], cmp, c[100005];
bool ind;
vector<int> g[100005];
int dfs(int v) {
  used[v] = cmp;
  int s = 0;
  for (int i = 0; i < g[v].size(); i++) {
    if (!used[g[v][i]]) s += dfs(g[v][i]);
  }
  return 1 + s;
}
bool DFS(int v, int col) {
  used[v] = col;
  if (!col)
    cnt1++;
  else
    cnt2++;
  if (ind) return 0;
  for (int i = 0; i < g[v].size(); i++) {
    if (used[g[v][i]] == col) {
      ind = 1;
      return 0;
    }
    if (used[g[v][i]] == -1) {
      DFS(g[v][i], col ^ 1);
    }
  }
  return 1;
}
int main() {
  cin >> n >> m;
  if (!m) {
    cout << 3 << " " << n * (n - 1) * (n - 2) / 6;
    return 0;
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y), g[y].push_back(x);
  }
  bool ind = 0;
  for (int i = 1; i <= n; i++) {
    if (!used[i]) {
      cmp++;
      c[cmp] = i;
      int t = dfs(i);
      if (t > 2) {
        ind = 1;
      }
    }
  }
  if (!ind) {
    cout << 2 << " " << m * (n - 2) << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) used[i] = -1;
  for (int i = 1; i <= cmp; i++) {
    cnt1 = 0, cnt2 = 0;
    ind = 0;
    if (!DFS(c[i], 1)) {
      puts("0 1");
      return 0;
    }
    ans = ans + (cnt1 * (cnt1 - 1)) / 2 + (cnt2 * (cnt2 - 1)) / 2;
  }
  cout << 1 << " " << ans << endl;
}
