#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100][100];
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) cin >> a[i][j];
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    bool flag = 0;
    for (int j = 0; j < n; ++j)
      if (a[i][j] == 1 || a[i][j] == 3) {
        flag = 1;
        break;
      }
    if (flag == 0) {
      sum++;
    }
  }
  cout << sum << endl;
  for (int i = 0; i < n; ++i) {
    bool flag = 0;
    for (int j = 0; j < n; ++j)
      if (a[i][j] == 1 || a[i][j] == 3) {
        flag = 1;
        break;
      }
    if (flag == 0) {
      cout << i + 1 << ' ';
    }
  }
  return 0;
}
