#include <bits/stdc++.h>
using namespace std;
bool mark[100];
int main() {
  int n, A[100][100];
  cin >> n;
  int k = n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> A[i][j];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (A[i][j] == 1 or A[i][j] == 3) {
        mark[i] = true;
        k--;
        j = n;
      }
    }
  cout << k << endl;
  for (int i = 0; i < n; i++)
    if (!mark[i]) cout << i + 1 << ' ';
}
