Define a “faulty addition” as the process of adding the digits without adhering to the standard rules of carrying. For example:
Given an integer n, count the number of non-negative integer pairs a,b such that the faulty addition of a and b results in n.
Input:
111
Output:
40