#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  int a[n][n], re[n], q = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) cin >> a[i][j];
  for (int i = 0; i < n; i++) {
    bool flag = true;
    for (int j = 0; j < n; j++) {
      if (i == j)
        continue;
      else {
        if (a[i][j] == 1 || a[i][j] == 3) {
          flag = false;
          break;
        }
      }
    }
    if (flag == true) {
      re[q] = i;
      q++;
    }
  }
  cout << q << endl;
  for (int i = 0; i < q; i++) cout << re[i] + 1 << " ";
}
