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); long A = sc.nextLong(); long B = sc.nextLong(); int T = sc.nextInt(); long min = 2000000000; for(long i=0;i*B<=T && i<=A;i++ ) min = Math.min(min, i*B+(T-i*B+A-1)/A*A); System.out.println(min); } }