#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long a, b, c;
  cin >> a >> b >> c;
  long long t = b * ((long long)a / b);
  if (a % b) t += b;
  long long x = a + a;
  long long y = t - a;
  long long z = x + y;
  long long ans = (c + c) / z;
  long long cc = (c + c) % z;
  long double tmp = x;
  long double trt = 0;
  tmp = cc / tmp;
  if (tmp > 1.0) {
    tmp -= 1.0;
    tmp *= x;
    trt = tmp / y;
    tmp = 1.0;
  }
  long double ret = a * tmp;
  long double res = t * ans + trt * y + ret;
  cout << fixed << setprecision(9) << res << endl;
  return 0;
}
