def catalan(n):
    catalan.counter += 1
if n <= 1:
    return 1
res = 0
for i in range(n):
    res += catalan(i) * catalan(n - i - 1)
return res
catalan.counter = 0
print(catalan(5))
print(catalan.counter)
Counting recursive calls of a function