#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int lf;
  int rt;
  void read() { scanf("%d %d", &lf, &rt); }
};
Edge data[100001];
vector<int> graph[100001];
int t, w;
bool can;
bool visit[100001] = {0};
int color[100001] = {0};
int grp[100001], tGrp = 0;
int compNum[100001];
int colorCnt[100001][2] = {0};
void biColor(int id, int col) {
  visit[id] = true;
  color[id] = col;
  for (int i = 0; can && i < graph[id].size(); i++) {
    if (color[graph[id][i]] == col) {
      can = false;
      return;
    }
    if (!visit[graph[id][i]]) biColor(graph[id][i], 3 - col);
  }
}
bool hasOddCycle() {
  int i;
  for (i = 1; i <= t; i++) {
    if (!visit[i]) {
      can = true;
      biColor(i, 1);
      if (!can) return true;
    }
  }
  return false;
}
void dfs(int id) {
  grp[id] = tGrp;
  compNum[tGrp]++;
  for (int i = 0; i < graph[id].size(); i++)
    if (grp[graph[id][i]] == -1) dfs(graph[id][i]);
}
void divide() {
  int i;
  for (i = 1; i <= t; i++) grp[i] = -1;
  for (i = 1; i <= t; i++) {
    if (grp[i] == -1) {
      dfs(i);
      tGrp++;
    }
  }
}
bool includeThreePoint() {
  for (int i = 0; i < tGrp; i++)
    if (compNum[i] >= 3) return true;
  return false;
}
long long C_2(int p) { return (long long)p * (p - 1) / 2; }
long long C_3(int p) { return (long long)p * (p - 1) * (p - 2) / 6; }
int main() {
  int i, j;
  long long ans = 0;
  scanf("%d %d", &t, &w);
  for (i = 0; i < w; i++) {
    data[i].read();
    graph[data[i].lf].push_back(data[i].rt);
    graph[data[i].rt].push_back(data[i].lf);
  }
  if (w == 0)
    printf("3 %lld\n", C_3(t));
  else {
    if (hasOddCycle())
      printf("0 1\n");
    else {
      divide();
      if (includeThreePoint()) {
        for (i = 1; i <= t; i++) colorCnt[grp[i]][color[i] - 1]++;
        for (i = 0; i < tGrp; i++)
          for (j = 0; j < 2; j++)
            if (colorCnt[i][j] > 1) ans += C_2(colorCnt[i][j]);
        printf("1 %lld\n", ans);
      } else {
        for (i = 0; i < tGrp; i++)
          if (compNum[i] > 1) ans++;
        ans *= t - 2;
        printf("2 %lld\n", ans);
      }
    }
  }
  return 0;
}
