#include <bits/stdc++.h>
const double eps = 1e-19;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const int MAXN = 105;
const int MAXM = 10005;
using namespace std;
int n, m;
char a[MAXN][MAXM];
int l, r, nowlvl, pos, k;
long long ans;
void sdvig(int& kx, int dx) {
  while (kx >= 0 && kx < m && a[nowlvl][kx] == '.' && a[nowlvl + 1][kx] != '.')
    kx += dx;
}
bool beton(int x) { return (x < 0 || x >= m || a[nowlvl][x] == '#'); }
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", a[i]);
  }
  nowlvl = 0;
  l = 0;
  r = 0;
  pos = 0, k = 0;
  while (nowlvl < n - 1) {
    if (k) {
      sdvig(l, -1);
      if (beton(l)) {
        sdvig(r, 1);
        if (beton(r)) break;
        ans += abs(pos - l);
        pos = l + 1;
        k ^= 1;
      } else {
        if (a[nowlvl][l] == '.') {
          ans += abs(pos - l + 1);
          nowlvl++;
          r = l;
          pos = l;
        } else {
          ans += abs(pos - l);
          k ^= 1;
          pos = l + 1;
          a[nowlvl][l] = '.';
        }
      }
    } else {
      sdvig(r, 1);
      if (beton(r)) {
        sdvig(l, -1);
        if (beton(l)) break;
        ans += abs(r - pos);
        pos = r - 1;
        k ^= 1;
      } else {
        if (a[nowlvl][r] == '.') {
          ans += abs(r - pos + 1);
          nowlvl++;
          l = r;
          pos = r;
        } else {
          ans += abs(r - pos);
          k ^= 1;
          pos = r - 1;
          a[nowlvl][r] = '.';
        }
      }
    }
  }
  if (nowlvl < n - 1)
    printf("Never");
  else
    cout << ans;
  return 0;
}
