#include <stdio.h>
int main(void) {
int a[30];
int n=0;
a[0]=2;
a[1]=-1;
while(a[n]<=5000){
a[n+2]=-a[n+1]+a[n]+2;
n++;
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CmludCBtYWluKHZvaWQpIHsKICAgIGludCBhWzMwXTsKICAgIGludCBuPTA7CiAgICBhWzBdPTI7CiAgICBhWzFdPS0xOwogICAgd2hpbGUoYVtuXTw9NTAwMCl7CiAgICAJYVtuKzJdPS1hW24rMV0rYVtuXSsyOwogICAgCW4rKzsKICAgIH0KICAgIHByaW50ZigiJWQiLG4pOwoJcmV0dXJuIDA7Cn0K