The Envelope Gambit

Imagine you are presented with four envelopes. Three are empty, and one holds €100. You may open envelopes one at a time with a fee of €X per attempt. What value of X results in the game being financially fair, considering your expected earnings over many games?

Answer format: enter an integer.