Fun With Permutations Who doesn't absolutely love permutations, right? I know, they are amazing––so much fun!

Well, why not take this fun and make it funner?

Here's the challenge:

Given an input in the exact form: nPr, where n is the pool taken from and r is the number of selections from that pool (and n and r are integers), output/return the exact number of  permutations. For those of you that are a bit rusty with the terminology: Permutation, def. 2a.

However, this is where the challenge comes into play (makes it not too easy):


  You may not use any built in library, framework, or method for your permutation function. You may not use a factorial method, permutation method, or anything of the sort; you must write everything yourself.


If further clarification is needed, please, do not hesitate to tell me in the comments and I will promptly act accordingly.


Here is an I/O example:

Sample function is permute(String) -&gt; int

Input:

permute("3P2")


Output:

6


This is code-golf, so shortest code wins!
CJam, 15 14 bytes

r~\;~\),&gt;UXt:*


Try it online in the CJam interpreter.

How it works

r              e# Read a token ("nPr") from STDIN.
 ~             e# Evaluate. This pushes the numbers n, Pi and r on the stack.
  \;           e# Discard Pi.
    ~          e# Take the bitwise NOT of r. Pushes -(r+1).
     \)        e# Increment n.    
       ,       e# Turn n+1 into [0 ... n].
        &gt;      e# Keep only the last r+1 elements.
         UXt   e# Replace the first element with 1.
               e# This avoid dealing with the egde case nP0 separately.
            :* e# Compute their product.