#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int matrix[n][n];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> matrix[i][j];
  int b[n];
  for (int i = 0; i < n; i++) b[i] = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (matrix[i][j] == 1) {
        b[i] += 1;
      } else if (matrix[i][j] == 2) {
        b[j] += 1;
      } else if (matrix[i][j] == 3) {
        b[i] += 1;
        b[j] += 1;
      }
    }
  int m = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] == 0) {
      m = m + 1;
    }
  }
  cout << m << endl;
  for (int i = 0; i < n; i++) {
    if (b[i] == 0) {
      cout << i + 1 << ' ';
    }
  }
}
