#include <bits/stdc++.h>
using namespace std;
bool flag[10010];
int main() {
  int n;
  cin >> n;
  int cnt = n;
  memset(flag, 0, sizeof(flag));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      int temp;
      cin >> temp;
      if (temp == 1 && flag[i] == false) flag[i] = 1, cnt--;
      if (temp == 2 && flag[j] == false) flag[j] = 1, cnt--;
      if (temp == 3) {
        if (flag[i] == false) flag[i] = 1, cnt--;
        if (flag[j] == false) flag[j] = 1, cnt--;
      }
    }
  cout << cnt << endl;
  for (int i = 1; i <= n; i++)
    if (flag[i] == false) cout << i << ' ';
  cout << endl;
  return 0;
}
