1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <stdio.h>


int main() {
  char ans[] = "2\n2\n1 2\n";
  int ch = getchar_unlocked();
  int x = 0;
  
initial_spaces:
  if(ch < '0') {
    ch = getchar_unlocked();
    goto initial_spaces;
  }
  
number_n:
  if(ch >= '0') {
    ch = getchar_unlocked();
    goto number_n;
  }
  
data:
  if(ch == EOF) {
    goto end;
  } else if(ch < '0') {
    ch = getchar_unlocked();
    goto data;
  }
  
/* possible one */
  if(ch == '1') {
    if((ch = getchar_unlocked()) < '0') {
      if((++x) == 2) goto end;
      goto data;
    }
  }
  
number_a:
  if(ch >= '0') {
    ch = getchar_unlocked();
    goto number_a;
  }
  
  goto data;
  
end:
  ans[0] -= x;
  fwrite(ans, 1, 8, stdout);
  
  return 0;
}