#include <bits/stdc++.h>
using namespace std;
const long long int M = 1e5 + 5, LG = 17, inf = 1e9, mod = 1e9 + 7;
long long int n, m;
long long int mol[M];
bool bpc[M];
vector<long long int> g[M];
long long int tbpc[M][2];
void bp(long long int x) {
  tbpc[mol[x]][bpc[x]]++;
  for (long long int y : g[x]) {
    if (mol[y] == 0) {
      mol[y] = mol[x];
      bpc[y] = !bpc[x];
      bp(y);
    } else {
      if (bpc[y] == bpc[x]) {
        cout << "0 1";
        exit(0);
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  if (m == 0) {
    cout << "3 " << (n * (n - 1) * (n - 2)) / 6;
    return 0;
  }
  bool b = 0;
  for (int i = 0; i < m; i++) {
    long long int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
    b |= (((long long int)g[u].size()) > 1 || ((long long int)g[v].size()) > 1);
  }
  if (!b) {
    cout << "2 " << (m * (n - 2));
    return 0;
  }
  long long int c = 0;
  for (int i = 0; i < n; i++) {
    if (mol[i] == 0) {
      mol[i] = ++c;
      bp(i);
    }
  }
  long long int res = 0;
  for (int i = 1; i < c + 1; i++)
    for (int j = 0; j < 2; j++) {
      res += tbpc[i][j] * (tbpc[i][j] - 1) / 2;
    }
  cout << "1 " << res;
}
