#include <bits/stdc++.h>
using namespace std;
const int N = 1e3, MOD = 1e9 + 7;
long long int a[N][N], dp[N];
bool mark[N], vis;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long int n, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
      if (a[i][j] == 1 || a[i][j] == 3) vis = true;
    }
    if (vis == false) {
      dp[ans] = i + 1;
      ans++;
    }
    vis = false;
  }
  cout << ans << "\n";
  for (int i = 0; i < ans; i++) cout << dp[i] << " ";
  return (0);
}
