using System;
using System.Linq;
public class Program
{
public static void Main()
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int c = int.Parse(Console.ReadLine());
int n, l;
int guess = 0;
for(n = 999; b < n; n--)
if (n % b == 0)
break;
}
for (l = 1000; l > c; l++)
if(l % c == 0)
guess = a + n + l;
Console.WriteLine(guess);