def calc_horizontal_depth(lines):
    """
    Calculate horizontal depth

    :param lines: List of tuples of lines from file
    :returns: Horizontal position multiplied by final depth
    """
    horizontal, depth = 0, 0

    for command in lines:
        # command = ('forward', '5')
        units = int(command[1])
        if command[0] == "forward":
            horizontal += units
        elif command[0] == "down":
            depth += units
        elif command[0] == "up":
            depth -= units

    # final horizontal position multiplied by final depth
    return horizontal * depth