// Danny Wasserman
// 7/14/2011
// Solution for BHCSI 2011 Practice Contest #1 Problem: Pizza

import java.io.*;
import java.util.*;

public class pizza
{
	public static void main(String[] args) throws IOException
	{
		
		Scanner in = new Scanner(new File("pizza.in"));
			
		// Read in the number of pizzas and convert to slices.
		int slices = in.nextInt();
		slices *=8;
		
		// Read in the number of party attendees.
		int party1 = in.nextInt();
		int party2 = in.nextInt();
			
		// Calculates slices left after each party, in order.
		slices %= party1;
		slices %= party2;
			
		// Output the answer.
		System.out.println("You will have "+slices+" of pizza left over.");
	}
}