#include <bits/stdc++.h>
int main(void) {
  int a, b, c, x, y;
  while (scanf("%d,%d,%d", &a, &b, &c) != EOF) {
    x = 0;
    y = 0;
    if ((a * a + b * b == 5 * 5) || (b * b + c * c == 5 * 5) ||
        (a * a + c * c == 5 * 5)) {
      x += 1;
    }
    if ((a * a + b * b == 8 * 8) || (b * b + c * c == 8 * 8) ||
        (a * a + c * c == 8 * 8)) {
      y += 1;
    }
  }
  printf("%d\n%d\n", x, y);
  return 0;
}
