import java.util.*; class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int yuki = sc.nextInt(); int huri = sc.nextInt(); int n = sc.nextInt(); HashMap map = new HashMap<>(); for (int i=0; i e: map.entrySet()) { ans += (e.getValue()-1) * (yuki+huri); } System.out.println(ans); } }