#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ss second
#define ff first
#define all(a) a.begin(), a.end()
#define All(a) a.rbegin(), a.rend()
#define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.precision(10), cout << fixed
//double Time=clock();
int main() {
    ios;
    int a, b;
    cin >> a >> b;
    cout << max({a + b, a + (a - 1), b + (b - 1)});
    //cout <<endl<< clock() - Time << endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;


typedef long long ll;
typedef pair<int, int> P;

struct edge {int to; ll cost; };

int dx[] = {-1, 1, 0,  0};
int dy[] = { 0, 0, 1, -1};

 
int main(){
  int n, k;
  cin >> n >> k;
  double ans = 0.0, ex = 0.0;
  vector<double> p(n);
  for(int i=0; i<n; i++){
    cin >> p[i];
  }
  for(int i=0; i<k; i++){
    ex += 1+p[i];
  }
  if(n==k){
    ex /= 2.0;
    cout << ex << endl;
    return 0;
  }
  ans = ex;
  for(int i=k; i<n; i++){
    ex = ex-p[i-k]+p[i];
    ans = max(ans, ex);
  }
  ans /= 2.0;
  printf("%.6lf", ans);
  return 0;
}
