 
 <prompt> ```Carly get 1489106 cards, 2/5 of the cards get the letter A on top, 1/2 of the remaining get the letter B, 5/8 of the rest get the letter C on top, and the others get the letter D. How many of the cards get the letter D on top? Think and write in python.``` <response>: ```
def solution():
    """Carly get 80 cards, 2/5 of di cards get letter A, 1/2 of di remaining get letter B, 5/8 of di rest get letter C, and di others get letter D. How many of di cards get letter D?"""
    num_cards = 1489106
    cards_a = num_cards*2/5
    cards_left = num_cards - cards_a
    cards_b = cards_left/2
    cards_left = num_cards - cards_a - cards_b
    cards_c = cards_left*5/8
    cards_d = num_cards - cards_a - cards_b - cards_c
    result = cards_d
    return result
``` 