If A = {1, 2, 3} and B = {a, b}, write total number of functions from A to B.