#!/bin/python3 import sys def howManyGames(p, d, m, s): count=0 c=s while(c>6): count=count+1 k=p-d if(c>=m and k>=6): c=c-p p=p-d else: c=c-6 return count if __name__ == "__main__": p, d, m, s = input().strip().split(' ') p, d, m, s = [int(p), int(d), int(m), int(s)] answer = howManyGames(p, d, m, s) print(answer)