#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[100][100];
  vector<int> voc;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    bool turnover = false;
    for (int j = 0; j < n; j++) {
      if (arr[i][j] == 1 || arr[i][j] == 3) {
        turnover = true;
        break;
      }
    }
    if (!turnover) voc.push_back(i + 1);
  }
  int size = voc.size();
  cout << size << endl;
  for (int i = 0; i < size; i++) {
    cout << voc[i] << ' ';
  }
  return 0;
}
