package com.thinker.bishi.saima;

import java.util.Scanner;

/**
 * @author lzh
 * <p href="http://exercise.acmcoder.com/online/online_judge_ques?ques_id=1668&konwledgeId=134">
 *     http://exercise.acmcoder.com/online/online_judge_ques?ques_id=1668&konwledgeId=134
 * </p>
 */
public class Stairs {
    private static int count = 0;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if(n <= 0) return;
        for(int i=0;i<n;i++){
            int m = in.nextInt();
            result(m);
            System.out.println(count);
            count = 0;
        }
    }
    private static void result(int m){
        go(m,1);
        go(m,2);
    }

    private static void go(int m,int step){
        if(m <= 1 || m <= step){
            if(m == 1 && m == step){
                count ++;
            }
            return;
        }
        m -= step;
        go(m,1);
        go(m,2);

    }
}
