#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long sumSecond = 0;
  char cell[101][10003];
  scanf("%d%d", &n, &m);
  int i, j;
  for (i = 0; i < n; i++) scanf("%s", &cell[i][1]);
  for (i = 0; i < n; i++) {
    cell[i][0] = '#';
    cell[i][m + 1] = '#';
  }
  int direction = 1;
  j = 1;
  for (i = 0; i < n - 1; i++) {
    int left = j, right = j;
    int countWall = 0, firstWall = j;
    while (1) {
      if (cell[i + 1][j] == '.') {
        sumSecond++;
        break;
      } else {
        if (cell[i][j + direction] == '+') {
          cell[i][j + direction] = '.';
          if (direction == 1) {
            right = j + direction;
            j = left;
          } else {
            left = j + direction;
            j = right;
          }
          sumSecond += right - left;
          direction = -direction;
        } else if (cell[i][j + direction] == '#') {
          if (firstWall != j + direction) {
            countWall++;
            firstWall = j + direction;
          }
          if (countWall == 2) {
            cout << "Never" << endl;
            return 0;
          }
          if (direction == 1) {
            right = j;
            j = left;
          } else {
            left = j;
            j = right;
          }
          sumSecond += right - left + 1;
          direction = -direction;
        } else {
          j += direction;
          sumSecond++;
        }
      }
    }
  }
  cout << sumSecond << endl;
  return 0;
}
