#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10005;
const int MOD = 1000000007;
int n, m;
char grid[102][10002];
bool conc(int i, int x) { return x < 0 || x >= m || grid[i][x] == '#'; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) {
      grid[i][j] = s[j];
    }
  }
  int l = -1, r = 0;
  long long ans = 0;
  bool dir = 0;
  bool flag = true;
  for (int i = 0; i < n - 1; i++) {
    while (true) {
      if (conc(i, l) && conc(i, r)) {
        flag = false;
        cout << "Never" << endl;
        break;
      }
      if (l != r) ans += r - l - 1;
      if (dir) {
        if (!conc(i, l)) {
          bool fell = false;
          grid[i][l] = '.';
          while (l >= 0 && grid[i][l] == '.') {
            ans++;
            if (grid[i + 1][l] == '.') {
              r = l;
              fell = true;
              break;
            }
            l--;
          }
          if (fell) break;
        }
      } else {
        if (!conc(i, r)) {
          bool fell = false;
          grid[i][r] = '.';
          while (r < m && grid[i][r] == '.') {
            ans++;
            if (grid[i + 1][r] == '.') {
              l = r;
              fell = true;
              break;
            }
            r++;
          }
          if (fell) break;
        }
      }
      dir = !dir;
    }
    if (!flag) break;
  }
  if (flag) cout << ans << endl;
  return 0;
}
