// omae wa mou shindeiru
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define ff              first
#define ss              second
#define float           double
#define ll              long long
#define int             long long
#define pb              push_back
#define ppb             pop_back
#define pf              push_front
#define ppf             pop_front
#define mp              make_pair
#define all(v)          v.begin(),v.end()
#define uniq(v)         (v).erase(unique(all(v)),(v).end())
#define endl            "\n"
 
#define pii             pair<int,int>
#define pll             pair<ll, ll>
#define vi              vector<int>
#define vl              vector<ll>
#define vpii            vector<pii>
#define vpll            vector<pll>
#define vvi             vector<vi>
#define vvl             vector<vl>
 
#define rep(i,a,b)      for(int i=a;i<b;i++)
#define tr(it, l)       for(auto it = l.begin(); it != l.end(); it++)
#define max(a, b)       ((a < b) ? b : a)
#define min(a, b)       ((a > b) ? b : a)
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mem1(a)         memset(a,-1,sizeof(a))
#define mem0(a)         memset(a,0,sizeof(a))
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
 
#define PI              3.1415926535897932384626433832795
#define eps             1e-9
#define mod             1000000007
#define inf             1e18
 
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename T, typename T1>T amax(T &a, T1 b) {if (b > a)a = b; return a;}
template<typename T, typename T1>T amin(T &a, T1 b) {if (b < a)a = b; return a;}
template<typename T>
using pbds = tree<T , null_type , less<T> , rb_tree_tag , tree_order_statistics_node_update>;

 
void runtime()
{
    int n,q;
    cin >> n >> q;
    vi a(n+1);
    rep(i,1,n+1)
    cin >> a[i];
    vi pre(n+1);
    pre[1] = a[1] - 1;
    for(int i=2;i<=n;i++)
    {
        pre[i] = pre[i-1] + (a[i]-a[i-1]-1);
    }
    while(q--)
    {
        int k;
        cin >> k;
        int p = lower_bound(all(pre),k) - pre.begin();
        // cout << p << " ";
        int s = k - pre[p-1];;
        cout << a[p-1] + s<<endl;

    }

}
 
 
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
 
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
 
    int TESTS = 1; // one input
    // cin >> TESTS;
    while (TESTS--) {
        runtime();
        cout << "\n";
    }
    return 0;
}
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;*/
#include<algorithm>
#include <bits/stdc++.h>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<ctype.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define S second
#define F first
#define vi vector<ll>
#define pii pair<ll,ll>
#define bc __builtin_popcountll
#define vvi vector<vi> 
#define vpii vector<pair<ll,ll>>
#define mll unordered_map<ll,ll>
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define fo(i,a,b) for(ll i=a;i<=b;i++)
#define f(i,n) for(ll i=0;i<n;i++)
#define f1(i,n) for(ll i=1;i<=n;i++)
#define fb(i,n) for(ll i=n-1;i>=0;i--)
#define fb1(i,n) for(ll i=n;i>0;i--)
#define endd cout<<'\n';
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define fr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define all(x) x.begin(), x.end()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define CASES  ll t;cin>>t;while(t--)
typedef long long ll;
typedef unsigned long long ull;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
//*X.find_by_order()-->returns an iterator to the k-th largest element (counting from zero)
//X.order_of_key()-->the number of items in a set that are strictly smaller than our item.
struct cmp
{
	bool operator() (ll a,ll b){
		return (a>b);
	}
};
ll ceil(const ll &a, const ll &b)
{
    if(a%b == 0)
        return a/b;
    return a/b +1;
}
ll mod=1000000007;
const ll N=100005;
int main()
{
fast;
    ll n,m;
    cin>>n>>m;
    char s[n][m];
    f(i,n)
    {
        f(j,m)
        {
            cin>>s[i][j];
        }
    }
    ll ans=0;
    f(i,n)
    {
        f(j,m)
        {
            if(s[i][j]=='.')
            {
                if(j==m-1 && i==n-1)
                {
                    continue;
                }
                else if(j==m-1)
                {
                    if(s[i+1][j]=='.')
                        ans++;
                }
                else if(i==n-1)
                {
                    if(s[i][j+1]=='.')
                        ans++;
                }
                else
                {
                    if(s[i+1][j]=='.')
                        ans++;
                    if(s[i][j+1]=='.')
                        ans++;
                }
            }
        }
    }
    cout<<ans;
    return 0;
}