If the discarded card is an artifact card, it will be counted as you determine the value of X, provided it's still in the graveyard or, optimistically, on the battlefield under your control at that time.