#include <bits/stdc++.h>
using namespace std;
int arr[100][100];
int sarr[100];
int main() {
  int total = 0;
  int counter = 0;
  int x;
  cin >> x;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < x; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < x; i++) {
    bool flag = false;
    for (int j = 0; j < x; j++) {
      if (arr[i][j] == 1 || arr[i][j] == 3) {
        flag = true;
      }
    }
    if (!flag) {
      total++;
      sarr[counter] = i + 1;
      counter++;
    }
  }
  cout << total << endl;
  for (int i = 0; i < counter; i++) {
    cout << sarr[i];
    if (i != counter - 1) cout << " ";
  }
  return 0;
}
