#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int map[101][101];
  int dp[101];
  while (scanf("%d", &n) == 1) {
    for (int i = 1; i <= n; i++) dp[i] = 1;
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) {
        scanf("%d", &map[i][j]);
        if (map[i][j] == 1) {
          dp[i] = 0;
        } else if (map[i][j] == 2) {
          dp[j] = 0;
        } else if (map[i][j] == 3) {
          dp[i] = 0;
          dp[j] = 0;
        }
      }
    int count = 0;
    for (int i = 1; i <= n; i++) {
      if (dp[i] == 1) count++;
    }
    cout << count << endl;
    if (count != 0) {
      for (int i = 1; i <= n; i++) {
        if (dp[i] == 1) cout << i << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
