#include <bits/stdc++.h>
int main() {
  long long int A[100][100], n(0), count(0), B[100];
  int flag(0);
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      std::cin >> A[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    flag = 1;
    for (int j = 0; j < n; j++) {
      if (A[i][j] == 0 || A[i][j] == -1 || A[i][j] == 2)
        flag = 0;
      else {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      B[count] = i;
      count++;
    }
  }
  std::cout << count << std::endl;
  if (count > 0) {
    for (int i = 0; i < count; i++) std::cout << B[i] + 1 << " ";
    std::cout << std::endl;
  }
}
