Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

The problem statement has recently been changed. View the changes.

×
F. Max Correct Set

time limit per test

4 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputLet's call the set of positive integers $$$S$$$ correct if the following two conditions are met:

- $$$S \subseteq \{1, 2, \dots, n\}$$$;
- if $$$a \in S$$$ and $$$b \in S$$$, then $$$|a-b| \neq x$$$ and $$$|a-b| \neq y$$$.

For the given values $$$n$$$, $$$x$$$, and $$$y$$$, you have to find the maximum size of the correct set.

Input

A single line contains three integers $$$n$$$, $$$x$$$ and $$$y$$$ ($$$1 \le n \le 10^9$$$; $$$1 \le x, y \le 22$$$).

Output

Print one integer — the maximum size of the correct set.

Examples

Input

10 2 5

Output

5

Input

21 4 6

Output

9

Input

1337 7 7

Output

672

Input

455678451 22 17

Output

221997195

Codeforces (c) Copyright 2010-2022 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/25/2022 10:32:28 (j3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|