// Arup Guha
// 5/10/2016
// Solution to USACO Gold December Problem: Fruit Feast

import java.util.*;
import java.io.*;

public class feast {

	public static void main(String[] args) throws Exception {

		// Read in data.
		BufferedReader stdin = new BufferedReader(new FileReader("feast.in"));
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		int max = Integer.parseInt(tok.nextToken());
		int a = Integer.parseInt(tok.nextToken());
		int b = Integer.parseInt(tok.nextToken());

		// Run regular subset sum DP for repeated items.
		boolean[] dp = new boolean[max+1];
		dp[0] = true;

		for (int i=a; i<=max; i++)
			if (dp[i-a])
				dp[i] = true;

		for (int i=b; i<=max; i++)
			if (dp[i-b])
				dp[i] = true;

		// Store all possibilities in a treeset.
		TreeSet<Integer> ts = new TreeSet<Integer>();
		for (int i=0; i<=max; i++)
			if (dp[i])
				ts.add(i);

		// This is the best we can do for now.
		int res = ts.last();

		// Try drinking water after each outcome.
		for (Integer x: ts)
			res = Math.max(res, x/2 + ts.lower(max-x/2+1));

		// Write result.
		PrintWriter out = new PrintWriter(new FileWriter("feast.out"));
		out.println(res);
		out.close();
		stdin.close();
	}
}