import re


def inc_arguments(expr, inc=1):
    """
    Increment $n substitutions of a fixed amount
    i.e. $1 will be substituted by $2 ecc ... 
    In general we will have every $(n) -> $(n + inc)
    """
    #a little criptic but effective, just believe it ;)
    return re.subn("\$\d+", lambda x: "$" + str(int(x.group()[1:]) + inc), expr)[0]