#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num, a[100000], sign = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> num;
      if (num == 1 || num == 3) sign++;
    }
    if (sign == 0) a[i] = 1;
    sign = 0;
  }
  int cnt = 0;
  for (int i = 0; i <= n; i++) {
    if (a[i]) cnt++;
  }
  cout << cnt << endl;
  for (int i = 0; i <= n; i++)
    if (a[i]) cout << i << ' ';
  cout << endl;
  return 0;
}
