import java.awt.print.Printable; import java.time.Year; import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); int T = sc.nextInt(); int min = 2000000000; for(int i=0;i*B<=T+B && i<=A;i++ ) min = Math.min(min, i*B+(T-i*B+A-1)/A*A); System.out.println(min); } }