#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int arr[n][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) cin >> arr[i][j];
    }
    int flag = 1;
    set<int> s;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (arr[i][j] == 1 or arr[j][i] == 3) {
          flag = 0;
        }
      }
      if (flag == 1) s.insert(i + 1);
      flag = 1;
    }
    cout << s.size() << endl;
    set<int>::iterator i;
    for (i = s.begin(); i != s.end(); i++) cout << *i << " ";
    cout << endl;
  }
  return 0;
}
