#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 100, MAXM = 10000;
char grid[MAXN + 2][MAXM + 2];
int n, m;
int l, r;
long long ans;
bool gaze = true;
bool move_right(int i) {
  while (r + 1 < m && grid[i][r + 1] == '.') {
    r++;
    if (grid[i + 1][r] == '.') {
      ans += r - l + 1;
      l = r;
      return true;
    }
  }
  ans += r - l + 1;
  if (grid[i][r + 1] == '+') grid[i][r + 1] = '.';
  return gaze = false;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> grid[i];
  for (int i = 0; i < n - 1; i++) {
    if (grid[i + 1][l] == '.') {
      ans++;
      continue;
    }
    if (gaze)
      if (move_right(i)) continue;
    do {
      while (l > 0 && grid[i][l - 1] == '.') {
        l--;
        if (grid[i + 1][l] == '.') {
          ans += r - l + 1;
          r = l;
          goto next_layer;
        }
      }
      ans += r - l + 1;
      if (l > 0 && grid[i][l - 1] == '+') grid[i][l - 1] = '.';
      gaze = true;
      if (move_right(i)) goto next_layer;
    } while (!((l == 0 || grid[i][l - 1] == '#') &&
               (r + 1 == m || grid[i][r + 1] == '#')));
    cout << "Never" << endl;
    return 0;
  next_layer:;
  }
  cout << ans << endl;
}
