Friends Pairing

easy
1. You are given a number n, representing the number of friends.
2. Each friend can stay single or pair up with any of it's friends.
3. You are required to print the number of ways in which these friends can stay single or pair up.
E.g.
1 person can stay single or pair up in 1 way.
2 people can stay singles or pair up in 2 ways. 12 => 1-2, 12.
3 people (123) can stay singles or pair up in 4 ways. 123 => 1-2-3, 12-3, 13-2, 23-1. 

Input Format

A number n

Output Format

A number representing the number of ways in which n friends can stay single or pair up.

Constraints

0 <= n <= 20

Example

Input
4
Output
10
Previous
Tiling With M * 1 Tiles
Next
Partition Into Subsets

Related Questions