#include <bits/stdc++.h>
using namespace std;int n,a,b;int Suma(int x){ int s=0; while(x>0) { s+=x%10; x/=10; } return s;}void Rezovare(){ int i,x,s,nr; double ma; cin>>a>>b>>n; s=nr=0; for(i=1;i<=n;i++) { cin>>x; if(a<=Suma(x) and Suma(x)<=b) { s+=x; nr++; } } ma=(double)s/nr; cout<<fixed<<setprecision(1)<<ma<<"\n";}int main(){ Rezovare(); return 0;}