#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int mat[n][n];
  int i, j;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> mat[i][j];
  vector<int> good;
  for (i = 0; i < n; i++) {
    int to = 0;
    for (j = 0; j < n; j++) {
      if (mat[i][j] == 1 || mat[i][j] == 3) to = 1;
    }
    if (to == 0) good.push_back(i + 1);
  }
  cout << good.size() << endl;
  for (i = 0; i < good.size(); i++) cout << good[i] << " ";
  return 0;
}
