class Solution(object):
    def subtractProductAndSum(self, n):
        """
        :type n: int
        :rtype: int
        """
        product = 1
        add =0
        while n>0:
            digit=n%10
            product*=digit
            add+=digit
            n=n/10
        return (product-add)

e295251af8026f51f76c3d194e9e8d30b85a5030
<mask token>

class Solution(object):
    <mask token>

class Solution(object):

    def subtractProductAndSum(self, n):
        """
        :type n: int
        :rtype: int
        """
        product = 1
        add = 0
        while n > 0:
            digit = n % 10
            product *= digit
            add += digit
            n = n / 10
        return product - add

class Solution(object):
    def subtractProductAndSum(self, n):
        """
        :type n: int
        :rtype: int
        """
        product = 1
        add =0
        while n>0:
            digit=n%10
            product*=digit
            add+=digit
            n=n/10
        return (product-add)
