UVa900 Brick Wall Patterns

#include <iostream>

using namespace std;

int main() {
  
  int N;
  while(cin >> N && N) {
    long long dp[55] = {};
    dp[1] = dp[2] = 1;
     
    for(int i=1; i<50; i++) {
      dp[i+1] += dp[i];
      dp[i+2] += dp[i];
    }
    cout << dp[N] << endl;
  }
  return 0;
}