Write a program to calculate the Nth Catalan number by given N.