#include <bits/stdc++.h>
using namespace std;
unsigned char cache[101][10001][2];
int main() {
  ios_base::sync_with_stdio(false);
  int rows, cols;
  cin >> rows >> cols;
  cin.ignore();
  string* grid = new string[rows];
  for (int i = 0; i < rows; i++) {
    getline(cin, grid[rows - i - 1]);
  }
  int x = 0, y = rows - 1;
  bool gazeright = true;
  long long int steps = 0;
  for (;;) {
    if (y == 0) break;
    int leftwall = x;
    int rightwall = x;
    int lefthole = x;
    int righthole = x;
    for (;;) {
      for (; leftwall > -1; leftwall--) {
        if (grid[y][leftwall] == '#' || grid[y][leftwall] == '+') break;
      }
      for (; rightwall < cols; rightwall++) {
        if (grid[y][rightwall] == '#' || grid[y][rightwall] == '+') break;
      }
      for (; lefthole > -1; lefthole--) {
        if (grid[y - 1][lefthole] == '.') break;
      }
      for (; righthole < cols; righthole++) {
        if (grid[y - 1][righthole] == '.') break;
      }
      if ((leftwall == -1 || grid[y][leftwall] == '#') &&
          (rightwall == cols || grid[y][rightwall] == '#') &&
          lefthole <= leftwall && righthole >= rightwall) {
        steps = -1;
        y = 0;
        break;
      }
      if (gazeright) {
        if (righthole < rightwall) {
          steps += righthole - x + 1;
          x = righthole;
          y--;
          break;
        } else {
          steps += rightwall - x;
          x = rightwall - 1;
          gazeright = !gazeright;
          if (grid[y][rightwall] == '+') grid[y][rightwall] = '.';
        }
      } else {
        if (lefthole > leftwall) {
          steps += x - lefthole + 1;
          x = lefthole;
          y--;
          break;
        } else {
          steps += x - leftwall;
          x = leftwall + 1;
          gazeright = !gazeright;
          if (grid[y][leftwall] == '+') grid[y][leftwall] = '.';
        }
      }
    }
  }
  if (steps == -1)
    cout << "Never" << endl;
  else
    cout << steps << endl;
  return 0;
}
