The transaction fee is independent from the number of inputs. It it a fixed amount calculated by multiplying the fee rate times the transaction size, and is not deducted from each transaction input, but sent from your wallet as well inside the transaction.
This works because the amount that you must pay in fees plus the total sum of the outputs must be less than the sum of the inputs, e.g. if you have a 0.5BTC input and want to send all (i.e. 0.5BTC) of it to some other address, making an output in the process, you must either add another input into the transaction or lower the amount being sent to one of the outputs.