import java.io.*; import java.util.*; public class Solution { static int a; static int b; /*private class Node(){ int p; Node left; Node right; public Node(int p){ this.p = p; this.left = null; this.right = null; } public Node(int p, Node l, Node r){ this.p = p; this.left = l; this.right = r; } } public Node createTree(int t, int p){ Node n = new Node(p); if (t == 0){ return n; } t--; n.left = createTree(t, p*a*.5); n.right = createTree(t, p*b*.5); return n; }*/ public static double calc(int t, double p){ if (t == 0){ return p; } t--; return calc(t, p*a*.5) + calc(t, p*b*.5); } public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner scan = new Scanner(System.in); a = scan.nextInt(); b = scan.nextInt(); int t = scan.nextInt(); System.out.println((int)calc(t, 1)); //Node head = createTree(t, 1); } }