1150: Morse Code

内存限制:8 MB 时间限制:1.000 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:3 通过:2 通过率:66.667%

题目描述

Morse code, also known as Morse code, is a kind of on-off signal code, which expresses different English letters, numbers and punctuation symbols through different order. It was invented in 1837 and is an early form of digital communication. Different from modern digital communication, Morse code consists of two basic signals: short point signal "•" and reading "drop"; Keep the long signal "-" for a certain time and read "Da".

 

In order to increase the difficulty of decoding, the communication group decided that there must be more than one short message number "•" between every two long signals "-" in Morse code of any length, otherwise it will be regarded as invalid code. For example, the number of schemes of an effective Morse code with a length of 3 is 5, which are respectively: - • -, - • •, - • -, • • -, • • •.



Here is the length of Morse code. Do you know the number of effective Morse code schemes?

 

输入格式

The input has multiple cases (no more than 100) of test data.

 

Each test case occupies one line, which is a positive integer N1 ≤ N ≤ 1000000 represents the length of the Morse code given to you.

 

The end of input will be represented by a line of test case where A equal to 0. This test case should not be processed.

输出格式

Each test case outputs a line, which is an integer, that is, the modular result of 2021 by the number of schemes of effective Morse code.

输入样例 复制

2
3
0

输出样例 复制

3
5