I want to generate all possible list from given range of list which will target given input sum : Input:target sum 
output: count of all possible pairs of given sum from : **list[1,2,3]**

Example:
Input
4

Output
7

Explanation

1, 1, 1, 1

1, 2, 1

1, 1, 2

1, 3

2, 1, 1

2, 2

3, 1


Note: for these given pairs for explanation of output these all must be taken from only and only.....**[1,2,3]** for any input... 