class Main{
java.
util.
Scanner i
= new java.
util.
Scanner(System.
in); int n = i.nextInt();
long array[] = new long[61];
array[0] = 1;
array[1] = 1;
array[2] = 2;
for(int k = 3; k <= n; k++) {
array[k] = array[k-1] + array[k-2] + array[k-3];
}
}
}
Y2xhc3MgTWFpbnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbiAJewoJCWphdmEudXRpbC5TY2FubmVyIGkgPSBuZXcgamF2YS51dGlsLlNjYW5uZXIoU3lzdGVtLmluKTsKCQlpbnQgbiA9IGkubmV4dEludCgpOwoJCWxvbmcgYXJyYXlbXSA9IG5ldyBsb25nWzYxXTsKCQlhcnJheVswXSA9IDE7CiAgICAJYXJyYXlbMV0gPSAxOwogICAgCWFycmF5WzJdID0gMjsKICAgIAlmb3IoaW50IGsgPSAzOyBrIDw9IG47IGsrKykgewogICAgICAgIAlhcnJheVtrXSA9IGFycmF5W2stMV0gKyBhcnJheVtrLTJdICsgYXJyYXlbay0zXTsKCQl9CgkJU3lzdGVtLm91dC5wcmludChhcnJheVtuXSk7Cgl9Cn0=