#include <bits/stdc++.h>
using namespace std;
int f[101][101];
int gg[101] = {};
int n, ans;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) cin >> f[i][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (f[i][j] == 1) gg[i] = 1;
      if (f[i][j] == 2) gg[j] = 1;
      if (f[i][j] == 3) gg[i] = gg[j] = 1;
    }
  ans = 0;
  for (int i = 1; i <= n; i++)
    if (gg[i] == 0) ans++;
  cout << ans << endl;
  if (ans != 0) {
    for (int i = 1; i <= n; i++)
      if (gg[i] == 0) cout << i << " ";
    cout << endl;
  }
  return 0;
}
