#include <bits/stdc++.h>
using namespace std;
char s[103][10003];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int i;
  for (i = 0; i < n; i++) scanf("%s", s[i]);
  int vz = 0;
  int pos = 0;
  long long ans = 0;
  int l, r;
  for (i = 0; i < n - 1; i++) {
    l = r = pos;
    bool ll, rr;
    ll = rr = false;
    while (true) {
      if (vz == 0) {
        if (s[i + 1][pos] == '.') {
          ans++;
          break;
        }
        if (pos == r) {
          if (r + 1 == m || s[i][r + 1] == '#') {
            vz ^= 1;
            rr = true;
            ans++;
          } else if (s[i][r + 1] == '.') {
            r++;
            pos++;
            ans++;
          } else {
            s[i][r + 1] = '.';
            vz ^= 1;
            ans++;
          }
        } else {
          ans += r - pos;
          pos = r;
        }
      } else {
        if (s[i + 1][pos] == '.') {
          ans++;
          break;
        } else if (pos == l) {
          if (l == 0 || s[i][l - 1] == '#') {
            ll = true;
            ans++;
            vz ^= 1;
          } else if (s[i][l - 1] == '+') {
            s[i][l - 1] = '.';
            ans++;
            vz ^= 1;
          } else {
            ans++;
            pos--;
            l--;
          }
        } else {
          ans += pos - l;
          pos = l;
        }
      }
      if (ll && rr) {
        printf("Never\n");
        return 0;
      }
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
