#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0;
  cin >> n;
  int arr[n][n];
  bool print_r[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++) print_r[i] = true;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < i; j++)
      if (arr[i][j] == 3) {
        print_r[i] = false;
        print_r[j] = false;
      } else if (arr[i][j] == 1)
        print_r[i] = false;
      else if (arr[i][j] == 2)
        print_r[j] = false;
  for (int i = 0; i < n; i++)
    if (print_r[i]) k++;
  cout << k << endl;
  for (int i = 0; i < n; i++)
    if (print_r[i]) cout << i + 1 << " ";
  return 0;
}
