#!/bin/python3 import sys def howManyGames(p, d, m, s): ans = 0 while(True): s -= p if(s<0): break p -= d if(p