#include <bits/stdc++.h>
int main() {
  int T = 10;
  while (T--) {
    int i, t, n = 0, ans[10], j, temp;
    for (i = 0; i < 10; i++) {
      scanf("%d", &t);
      temp = t % 42;
      for (j = 0; j < n; j++)
        if (ans[j] == temp) break;
      if (j == n) ans[n++] = temp;
    }
    printf("%d\n", n);
  }
  return 0;
}
