#include <bits/stdc++.h>
using namespace std;
int a[105][105];
bool v[2005];
int main() {
  int i, j, n, cnt;
  cin >> n;
  cnt = n;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 1) {
        if (v[i] == false) {
          v[i] = true;
          cnt--;
        }
      } else if (a[i][j] == 2) {
        if (v[j] == false) {
          v[j] = true;
          cnt--;
        }
      } else if (a[i][j] == 3) {
        if (v[i] == false) {
          v[i] = true;
          cnt--;
        }
        if (v[j] == false) {
          v[j] = true;
          cnt--;
        }
      }
    }
  cout << cnt << "\n";
  for (i = 1; i <= n; i++)
    if (v[i] == false) cout << i << " ";
  return 0;
}
