#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i, j;
  int count1[100];
  int count2 = 0;
  for (i = 0; i < 100; i++) count1[i] = 0;
  int a[101][101];
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) cin >> a[i][j];
  for (i = 0; i < n; i++) {
    int flag = 0;
    for (j = 0; j < n; j++) {
      if (a[i][j] == 3 or a[i][j] == 1) flag = 1;
    }
    if (flag == 0) {
      count2 += 1;
      count1[i] = 1;
    }
  }
  cout << count2 << '\n';
  for (i = 0; i < 100; i++)
    if (count1[i] == 1) cout << i + 1 << " ";
}
